🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). Log available at irclogs.raku.org/raku/live.html . If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 6 September 2022.
[Coke] vendethiel: IMO, we should not have placeholder releases in the ecosystem. 00:14
tonyo placeholders shouldn't be needed with the auth system .. dist:auth:ver:api 00:16
prevents name sitting on good dist names
vendethiel Tell that to ingy :-) 00:19
I don’t think you can say this is about namesquatting, the opposite rather. 00:20
ingy [Coke]: yamlscript should be released in full to raku quite soon 01:44
it is just a shared library binding, so not a lot of raku work to do 01:45
as vendethiel says is is being worked on (very heavily) by me and vendethiel :) 01:46
[Coke] ingy++ vendethiel++ 04:46
Xliff How can I add a method to a role, dynamically? 04:48
nemokosch What is yamlscript anyway? 06:39
m: role Foo {}; Foo.HOW.^methods.ⅆ 06:40
evalable6 (exit code 1) Died with X::Method::NotFound
in block <unit> at /tmp/UftwSxa2BJ line 1
Raku eval Exit code: 1 No such method 'raku' for invocant of type 'NQPRoutine' in block <unit> at main.raku line 1
nemokosch Meh
m: role Foo {}; .say for Foo.HOW.^methods 06:41
evalable6 (exit code 1) Died with X::Method::NotFound
in block <unit> at /tmp/XmNd23YNkc line 1
Raku eval Exit code: 1 No such method 'say' for invocant of type 'NQPRoutine' in block <unit> at main.raku line 1
nemokosch m: role Foo {}; .Str.say for Foo.HOW.^methods 06:42
evalable6 (exit code 1) Died with X::Method::NotFound
in block <unit> at /tmp/rl49T9C0GD line 1
Raku eval Exit code: 1 No such method 'Str' for invocant of type 'NQPRoutine' in block <unit> at main.raku line 1
nemokosch What even exists on it
m: role Foo {}; Foo.HOW.^methods.say 06:43
evalable6 (archetypes new set_selector_creator new_type p…
Raku eval (archetypes new set_selector_creator new_type parameterize !produce_parameterization add_possibility select_candidate specialize update_role_typecheck_list role_typecheck_list type_check candidates lookup methods attributes parents roles ver auth language-revision is-implementation-detail WHY set_why !get_default_candidate !get_nonsignatured_candidate publish_type_cache name set_name shortname set_shortname
evalable6 nemokosch, Full output: gist.github.com/58a65c3e226768d164...f96de697e2
add_stash pretend_to_be pretending_to_be configure_punning set_pun_repr pun_repr make_pun pun inheritalize find_method is_method_call_punned get_boolification_mode set_boolification_mode publish_boolification_spec EXISTS-KEY DELETE-KEY DELETE-POS cache list flat eager serial List Slip Array Seq hash Hash Map elems end keys kv values pairs antipairs invert splice pick roll match classify categorize reverse combinations
permutations join tree push append unshift prepend EXISTS-POS AT-POS ZEN-KEY ASSIGN-POS BIND-POS all any one none AT-KEY BIND-KEY ASSIGN-KEY FLATTENABLE_LIST FLATTENABLE_HASH Set SetHash Bag ...)
gfldex .seen Xliff 09:49
tellable6 gfldex, I saw Xliff 2023-10-26T04:48:12Z in #raku: <Xliff> How can I add a method to a role, dynamically?
gfldex gfldex: .tell Xliff see: gfldex.wordpress.com/2023/05/17/pl...g-strings/ 09:50
gfldex .tell Xliff see: gfldex.wordpress.com/2023/05/17/pl...g-strings/ 09:58
tellable6 gfldex, I'll pass your message to Xliff
erik`` Hi! I am trying to groc grammars. I'm looking to conditionally substitute part of a string depending on context. When a method in the action recognizes this context, I want another set of methods to become active. Is this possible? 10:03
lizmat that sounds like a slang ? 10:18
erik`` I will try to look into slangs. Thank you for the pointer. 10:50
vendethiel erik``: that’s when parsing using grammars, yes? Wouldn’t you just have two different rules in your grammar? 10:52
You can also use a dynamic variable
erik`` vendethiel: This is when parsing using grammars, you are right. The problem is that I want the effect of an action for a specific rule to depend on the context which it appears in. To give some more details about what I am doing: I am parsing a datalog program, and if an expression appears as the left hand side of a deduction rule, I want the action to behave differently. 11:00
Deduction rule in datalog, so not a rule in raku. 11:01
lizmat then using a dynamic variable feels like the simplest solution
erik`` All right, I will investigate dynamic variables. 11:03
vendethiel What’s the difference between both? 11:09
Sounds like something that should be resolved later than att parse time
lizmat you can create a dynamic variable inside a token/rule/regex with :my $*FOO
:my $*FOO;
actually, the semicolon is needed
erik`` vendethiel: difference between what? 11:16
My intention was to solve this inside an action. Should I not take this approach?
vendethiel Your grammar should produce a syntax tree 11:19
I think to parse datalog you shouldn’t need it at this stage 11:19
lizmat well, not necessarily: e.g. the sprintf grammar produces a string :-) 11:20
erik`` I am intending to make relatively simple modifications to the datalog code, and thought to simply let the action do the pattern matching for where to substitute. 11:22
And then build the resulting code simultaneously.
whatnext Hello - just a heads up to the raku community that I have a job posted here: www.upwork.com/jobs/~0138b3bac01123f8c3 12:31
[Coke] whatnext++ 12:52
whatnext (y) 13:26
antononcube That could be handled with standard rule- and actions programming. (Without dynamic variables, etc.) 13:27
grondilu m: say grammar { token TOP { <+print-[$]>+ } }.parse: q{foo$bar} 14:19
camelia Cannot resolve caller print(Mu:U: <anon|1>:D); none of these signatures matches:
(Mu: *%_)
in regex TOP at <tmp> line 1
in block <unit> at <tmp> line 1
grondilu why is it calling &print?
m: say q{foo$bar} ~~ /<+print-[$]>+/
camelia 「foo」
grondilu m: say q{foo$bar} ~~ /<+print>+/
camelia 「foo$bar」
grondilu m: say grammar { token TOP { <+print>+ } }.parse: q{foo$bar} 14:20
camelia Cannot resolve caller print(Mu:U: <anon|1>:D); none of these signatures matches:
(Mu: *%_)
in regex TOP at <tmp> line 1
in block <unit> at <tmp> line 1
grondilu m: say grammar { token TOP { <print>+ } }.parse: q{foo$bar}
camelia Cannot resolve caller print(Mu:U: <anon|1>:D); none of these signatures matches:
(Mu: *%_)
in regex TOP at <tmp> line 1
in block <unit> at <tmp> line 1
grondilu o_O
m: say grammar { token TOP { <print>+ } }.parse: q{foo}
camelia Cannot resolve caller print(Mu:U: <anon|1>:D); none of these signatures matches:
(Mu: *%_)
in regex TOP at <tmp> line 1
in block <unit> at <tmp> line 1
grondilu looks like a bug tbd 14:21
*tbh
m: say grammar { token TOP { <graph>+ } }.parse: q{foo}
camelia 「foo」
graph => 「f」
graph => 「o」
graph => 「o」
grondilu no one? 17:48
m: say grammar { token TOP { <print>+ } }.parse: q{foo}
camelia Cannot resolve caller print(Mu:U: <anon|1>:D); none of these signatures matches:
(Mu: *%_)
in regex TOP at <tmp> line 1
in block <unit> at <tmp> line 1
grondilu ^is that a bug?
lizmat am about to go afk 17:55
but that does not look like a bug: where is <print> supposed to be coming from? 17:56
grondilu isn't it a predefined character class?
m: say q{foo$bar} ~~ /<print>+/
camelia 「foo$bar」
print => 「f」
print => 「o」
print => 「o」
print => 「$」
print => 「b」
print => 「a」
print => 「r」
grondilu as in "printable character" 17:57
docs.raku.org/language/regexes#Pre...er_classes
m: say grammar { token TOP { <+print+space>+ } }.parse: q{foo} 17:59
camelia Cannot resolve caller print(Mu:U: <anon|1>:D); none of these signatures matches:
(Mu: *%_)
in regex TOP at <tmp> line 1
in block <unit> at <tmp> line 1
grondilu m: say grammar { token TOP { <+graph+space>+ } }.parse: q{foo}
camelia 「foo」
grondilu m: say grammar { token TOP { <+graph+space-cntrl>+ } }.parse: q{foo}
camelia No such method 'space-cntrl' for invocant of type '<anon|1>'
in regex TOP at <tmp> line 1
in block <unit> at <tmp> line 1
grondilu m: say grammar { token TOP { <+graph+space - cntrl>+ } }.parse: q{foo} 18:00
camelia 「foo」 18:01
melezhik .tell SmokeMachine: build is not good with the latest Rakudo version - ci.sparrowhub.io/report/3732 18:19
tellable6 melezhik, I'll pass your message to SmokeMachine
Xliff \o 19:48
tellable6 2023-10-26T09:58:21Z #raku <gfldex> Xliff see: gfldex.wordpress.com/2023/05/17/pl...g-strings/
Xliff How can I get a list of classes? 19:50
gfldex: Ah! Thanks for that. However that does not work from outside the role body, it seems. 19:52
m: role A { }; A.HOW.^can('declares_method').gist.say 19:53
camelia 0
Xliff m: role A { ::?ROLE.HOW.^can('declares_method').gist.say }; 19:54
camelia ( no output )
Xliff m: role A { ::?ROLE.^can('^declares_method').gist.say };
camelia ( no output )
tbrowder__ I'm trying to recover from an exception when an installed module's prog attempts to access a file NOT listed in the META6.json file's "resources" list. The module is available at 'github.com/tbrowder/Demo.git'. The relevant code is in this gist: 20:28
gist.github.com/tbrowder/86176edb5...325f796410 20:30
tbrowder__ I tried to follow the pertinent flow from the docs, but failed to trap the fatal attempt in the installed module. 20:31
Of note the doc example had a "bad-sub" with an empty signature so I tried to fake it. 20:32
Any help is most welcome. 20:33
gfldex Xliff: Please note that you have to finish a role before the first class uses it. 20:35
There is right now no way to get a list of all type-objects, if that's what you are looking for. 20:36
I got pretty far patching that into Rakudo, tho. Will try again after v6.e is released. 20:37
tbrowder__ *and appreciated! 21:07
leont I'm having a writers block with my slides, starting to get worried :-/ 21:55
lizmat everybody: please look the other way and don't pay any attention to leont 22:05
:-)
leont Heheh
xinming tbrowder__: $ ./rakudo-m -e ' $*DISTRO.name.say; $*DISTRO.version.say;' 22:13
tellable6 2023-10-25T13:34:41Z #raku <tbrowder__> xinming can you please post results here of running $*DISTRO.name and $*DISTRO.version on your system? i'm curious about the response on other linux systems
xinming gentoo
v6.5.3.gentoo
librasteve grondilu: I have replicated your issue with <print> ... suggest you make an issue on rakudo on github 22:16
SmokeMachine .tell melezhik thank you! I’ll take a look shortly
tellable6 SmokeMachine, I'll pass your message to melezhik
grondilu done: github.com/rakudo/rakudo/issues/5443 22:40
librasteve ^^++ 22:42
nemokosch @grondilu is there a predefined <print> character class? 22:49
sorry a bit lagging behind
librasteve docs.raku.org/language/regexes#Pre...er_classes 22:51
Xliff gfldex: How far along were you before you stopped patching? 22:53
And what would it take to get that finished?
nemokosch well that's kind of worrying 22:55
docs.raku.org/language/traps#Using...en/regexes it's probably this phenomenon on steroids