🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). This channel is logged for the purpose of keeping a history about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | Log inspection is getting closer to beta. If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 25 August 2021.
Nemokosch m: dd ('a'..'z').rotor(5) 10:42
camelia (("a", "b", "c", "d", "e"), ("f", "g", "h", "i", "j"), ("k", "l", "m", "n", "o"), ("p", "q", "r", "s", "t"), ("u", "v", "w", "x", "y")).Seq
lizmat m: dd ("a".."z").comb(5) # alternate ? 10:49
camelia ("a b c", " d e ", "f g h", " i j ", "k l m", " n o ", "p q r", " s t ", "u v w", " x y ", "z").Seq
lizmat hmm
aah...
m: dd ("a".."z").batch(5) # alternate ?
camelia (("a", "b", "c", "d", "e"), ("f", "g", "h", "i", "j"), ("k", "l", "m", "n", "o"), ("p", "q", "r", "s", "t"), ("u", "v", "w", "x", "y"), ("z",)).Seq
Nemokosch "it is a shorthand of .rotor($batch, :partial)" 10:51
lizmat it's a simpler, faster version 11:06
Xliff lizmat: Did you see the timings? 11:09
grondilu can't I define a FALLBACK method in an action class? 11:25
m: grammar { token TOP { foo } }.parse: "foo", actions => class { multi method FALLBACK($ where "bar") {...} }
camelia Cannot resolve caller FALLBACK((<anon|2>): TOP, 「foo」); none of these signatures matches:
(<anon|2>: $ where { ... }, *%_)
in regex TOP at <tmp> line 1
in block <unit> at <tmp> line 1
patrickb hythm: Which libcurl.dll did you use? Do you know which compiler that was compiled with? (mingw or msvc) Which compiler do you use for your builds on Windows? 11:26
tellable6 patrickb, I'll pass your message to hythm
patrickb hythm: Can you turn this into a bugreport? 11:27
tellable6 patrickb, I'll pass your message to hythm
gfldex lolibloggedalittle: gfldex.wordpress.com/2022/05/01/antipairing/ 12:23
SmokeMachine .ask melezhik are you planning on having a image badge to add on readme to show if the build has passed? I think that would help a lot. And thank you very much for all the work! That’s helping a lot! Most of the tests are not being skipped for Pg anymore! :) 17:10
tellable6 SmokeMachine, I'll pass your message to melezhik
Nemokosch batch just doesn't give the same result as rotor, though 17:39
and once you want to make it non-partial, I suspect batch isn't superior anymore
hythm patrickb, created rakubrew issue #54 and answered the questions there. let me know if I missed anything. thanks 20:24
tellable6 2022-05-01T11:26:49Z #raku <patrickb> hythm: Which libcurl.dll did you use? Do you know which compiler that was compiled with? (mingw or msvc) Which compiler do you use for your builds on Windows?
2022-05-01T11:27:17Z #raku <patrickb> hythm: Can you turn this into a bugreport?
Nemokosch Something odd happened 20:51
_nextwith is not in the dynamic scope of a dispatcher_
If this wasn't new enough for me: if I only give the proto {*}, the arguments seem to be passed wrong 20:53
if I make a dummy body with logging the arguments, they are passed right but this error message shows up for my nextwith call from a multi
check, the arguments are passed almost right - I thought the proto could be used for setting a default value? 20:59
okay, seems like it cannot: "can validate but not modify arguments" 21:05
this one I understand
still don't understand what happened when I gave it a block and hence broke `nextwith`
Anyway, I think this should work:
multi process-pair(@table, $mode, $a, $b = 'x') { nextsame }
and it doesn't
seems like same is too much the same 21:06
okay no, this could work 21:10
the argument passing somehow doesn't work from map 21:11
aaah 21:14
can I somehow tell a multi "if this argument is Nil, do accept but replace it with a default value"? 21:15
no no no, this never works as intended, that's for sure 21:24
if my proto has no default option, the map call fails when there was only 1 element left
so it's not the fault of the argument passing from map
if my proto does have a default option, Nil gets assigned instead 😡
MasterDuke i think that'd have to be done "manually", i.e., make it of type Mu, and in the body check and replace
m: multi sub a($a, Nil $b) { a($a, 42) }; multi sub a($a, $b) { say "$a $b" }; a(3, Nil) 21:27
camelia 3 42
Nemokosch anyway, what I'm trying to do just has too many ways to fail 21:32
however, I'm pretty sure that this fake default is incorrect behavior
if you cannot set a default on a proto, it should say that, not pretend to add a default argument and then set it to Nil 21:34
MasterDuke a quick `git grep proto | grep =` in roast doesn't show anything obviously testing that, so very well could be unspecced 21:44
gfldex nextsame will just pass on the Capture which is immutable. I would not expect defaults of one candidate to travel to the next that way. 21:52
If anything, this is an ENODOC.
Or better, it could be more precise and tell what is really going on. 21:53
Nemokosch Something else: why are @-sigilled variables treated as immutable when `given`? 22:04
Voldenet my @what = <are they now?>; given @what { .push('not at all'); }; say @what 22:50
evalable6 [are they now? not at all]
Voldenet m: my @what := <are they now?>; given @what { .WHAT.say; .push('…if they are lists'); }; say @what 22:53
camelia (List)
Cannot call 'push' on an immutable 'List'
in block <unit> at <tmp> line 1
Nemokosch this is not an assignment, though, it doesn't actually change the container
Voldenet m: my @sth = <this>; given @sth { @sth = "it works" }; say @sth 23:24
camelia [it works]
Bscan🍺 I released a vscode extension today for Raku. It defines the language and file extensions (otherwise only shows Perl 6), uses the syntax highlighting from the Atom extension, and contains a simple language server for syntax checking. marketplace.visualstudio.com/items...-navigator
Voldenet m: my @sth = <this>; given @sth { $sth = "this won't work" }; say @sth
camelia ===SORRY!=== Error while compiling <tmp>
Variable '$sth' is not declared. Did you mean '@sth'?
at <tmp>:1
------> my @sth = <this>; given @sth { ⏏$sth = "this won't work" }; say @sth
Voldenet m: my @sth = <this>; given @sth { @_ = "it also works" }; say @sth
camelia [this]
Voldenet m: my @sth = <this>; given @sth { $_ = "this won't work" }; say @sth
camelia Cannot assign to an immutable value
in block <unit> at <tmp> line 1
Voldenet I'm not sure if I get the question, but I wouldn't be able to answer either way 23:27