00:16 guifa joined
grondilu m: my $a = 3; my @jobs; @jobs.push: { print $a } while $a--; @jobs.pop.() while @jobs 00:26
camelia -1-1-1
grondilu ^kind of unexpected
guifa I really dislike that Nil.Str errors instead of returning Nil
grondilu m: my $pi = pi; my &f = { $pi }; $pi = 3; print &f() 00:28
camelia 3
grondilu wtf
Can't I "freeze" the values when defining a block/function?
m: my $pi = pi; my &f = { -> { $_ } }($x); $pi = 3; print &f() 00:29
camelia ===SORRY!=== Error while compiling <tmp>
Variable '$x' is not declared. Perhaps you forgot a 'sub' if this was
intended to be part of a signature?
at <tmp>:1
------> my $pi = pi; my &f = { -> { $_ } }(<HERE>$x); $pi = 3; print &f()
timo m: my $pi = pi; my &f = do given $pi -> $pi { { $pi }; }; $pi = 3; print &f()
camelia Type check failed in assignment to &f; expected Callable but got Num (3.141592653589793e0)
in block <unit> at <tmp> line 1
grondilu m: my $pi = pi; my &f = { -> { $_ } }($pi); $pi = 3; print &f()
camelia 3
timo m: my $pi = pi; my &f = do given $pi -> $pi { -> { $pi }; }; $pi = 3; print &f()
camelia 3.141592653589793
guifa you could use composition perhaps 00:30
grondilu or maybe a class?
guifa my $pi = pi; my &f1 = { $^value }; my &f2 = &f1 o $pi; $pi = 3; say f2;
timo the block closes over its outer, if you only have one instance of the outer, then you can only have one value that it will find
grondilu is it recent behavior spec? I'd swear this used to behave differently. 00:31
m: my $pi = pi; my &f = { -> { $_ } }(+$pi); $pi = 3; print &f()
camelia 3.141592653589793
grondilu ah this is better 00:32
timo i don't expect it'd have been different at any point
grondilu m: my $pi = pi; my &f = { -> { $_ } }($pi); $pi = 3; print &f() 00:37
camelia 3
grondilu hum for some reason I can't use that
timo you don't have to use a function argument, as long as you have a lexical in the outer of the code object you're returning, that gets the value assigned, that should work 00:39
m: my $pi = pi; my &f = do { my $pi-value = $pi; -> { $pi-value } }; $pi = 3; print &f()
camelia 3.141592653589793
timo gnite! o/ 00:40
00:44 melezhik left 00:51 guifa left
grondilu makes sense, thanks 00:51
00:57 ShimmerFairy left
disbot7 <.landyacht.> Is there some deep reason classes can't take type parameters but roles can? I'm sure this was considered but it beats the heck out of me... something about inheritance maybe? 01:11
01:28 ShimmerFairy joined 02:07 ShimmerFairy left, lue joined 02:22 johnjay left 02:33 hulk joined 02:34 kylese left 03:08 johnjay joined 03:15 hulk left, kylese joined
Geth docker: a85c48e962 | AntonOks++ | 6 files
Bump to 2025.12 [skip workflow]
03:22
03:45 lue is now known as ShimmerFairy 04:16 lichtkind_ joined 04:18 lichtkind__ left
SmokeMachine glot.io/snippets/he7y3z6idz 04:42
05:29 melezhik joined 06:25 Sgeo_ left 06:26 Aedil joined 06:31 Sgeo joined 08:14 Aedil left 09:28 melezhik left 09:51 Sgeo left 10:32 melezhik joined
lizmat .landyacht. because roles can, and roles autopun to classes ? 11:21
m: role foo[$bar] { method bar() { $bar } }; say foo[42].new.bar
camelia 42
12:09 guifa joined
tbrowder excellent year review, lizmat++! Happy Christmas to all (and a pox on those ppl who dumped trash here yesterday) 12:44
And thanks for the new mods to Test! 12:45
lizmat yw :-)
12:52 melezhik left 13:07 Aedil joined 13:39 guifa left 14:51 guifa joined 15:14 guifa left
tbrowder are they available without upgrading my local Raku? 15:50
15:58 Guest5764 joined 15:59 itaipu left 16:16 itaipu joined 16:33 melezhik joined
melezhik tbrowder: ++ happy new year šŸŽˆ 16:34
lizmat PSA: the Christmas Eve spam has been removed from the logs 16:44
disbot7 <antononcube> @tbrowder Can you solve this maze: 16:49
<antononcube> cdn.discordapp.com/attachments/633...78c19&
16:50 guifa joined
tbrowder antononcube ya gotta be kidding! 17:33
disbot7 <antononcube> @tbrowder šŸ™‚ I do not know -- you might have special powers. (Being ex-USAF, etc.) 17:38
<antononcube> Let me re-formulate the problem. Can you solve that maze: 1. Manually (using your 🧠 ) 2. Using image processing in Raku (or Python, or whatever) 3. Using an LLM 17:40
melezhik lizmat: thanks for mentioning brownie, quite a surprise )) 17:47
lizmat yw 17:48
17:50 xinming left
tbrowder antononcube: maybe w/ one of yr llms, but not in a hurry for sure… 17:51
17:53 xinming joined
guifa is legit annoyed that Buf.new() doesn't accept utf8, when AFAIK it's actually a blob8 backpinning it 17:53
uint8 I mean 17:54
timo uint8 you mean where exactly? 17:56
guifa m: my $foo = 'bar'; $foo.encode.Buf 17:57
camelia ( no output )
guifa hmmm
maybe it got corrected at some point
older version throws `No such method 'Buf' for invocant of type 'utf8'` 17:58
timo difference between .Buf and Buf.new maybe?
guifa i'm still working on my updated URI module
trying to debate the best and most efficient way to handle (and when) the percent encoding 17:59
Unicode is done by percent encoding UTF-8 encoded data so I can't just do something simple like .subst(/\%(..)/,{$1.Str.Int.chr) 18:01
timo oh that's fun, what happens when the data is b0rked 18:02
guifa i'm thinking easiest way is going to just be read in as a buf, then do a single linear scan before rereading in as UTF-8. Of course, you can have valid percent encoded string that's invalid utf-8 so
haha I was literally just typing that caveat out
timo oh lord
in utf8 initial bytes have the uppermost bit set and continuation bytes don't have it, was that right? 18:04
does that mean you could have two bytes percent encoded and the last byte a regular char?
guifa yeah, quite possible
well 18:05
no
any multi byte sequence always has initial 1
first byte is always 11
and trailing bytes are always 10
(first byte is actually 110 for two byte sequence, 1110 for three, and 11110 for four, and in theory you'd have 111110 reserved for a five byte if that were ever needed) 18:06
18:07 Guest5764 left
timo ok that's less worrysome. good. 18:08
guifa but either way, for normalization purposes, I think I'll just store as the uint8 18:09
and then when requested, convert to a Raku str
timo utf8-c8 may be used to store stuff in a way that can round-trip back
guifa one of the known security issues of UTF8 is trying to store certain strings using multibytes when not needed 18:10
like ../ (simple algorithm might scan for that exact three byte sequence which can be done very fast..... unless one of the dots is encoded strangely) 18:11
timo security, as in, you will end up with a string that looks equal but when looking at the bytes it isn't?
naively i would think you don't even accept that input while decoding the utf8 18:13
guifa yup that's the common solution 18:15
I mean, you can always normalize first and then check
but that means two iterations instead of one
in my case though, since I want valuetype semantics, i have to normalize anyways
18:51 Sgeo joined 19:53 melezhik left 20:57 jrjsmrtn_ left 21:26 guifa left 23:08 Aedil left
disbot7 <aruniecrisps> @.landyacht. you technically can extend ^parametrize for any class and it at allows you to add type parameters, but I imagine that it's not as straightforward to do it in classes cause there's a consensus that it's harder to reason about 23:27