🦋 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.
el m:perl given x => 1, y => 2 { say x } 00:51
Raku eval Exit code: 1 ===SORRY!=== Error while compiling /home/glot/main.raku Undeclared routine: x used at line 2
el m:perl given x => 1, y => 2 { when (:\x, :\y) { say x } } 00:52
Raku eval Exit code: 1 ===SORRY!=== Error while compiling /home/glot/main.raku Bogus statement at /home/glot/main.raku:2 ------> when (:⏏\x, :\y) { say x } expecting any of: colon pair
el m:perl given x => 1, y => 2 { when (:$x, :$y) { say $x } }
Raku eval Exit code: 1 ===SORRY!=== Error while compiling /home/glot/main.raku Variable '$x' is not declared at /home/glot/main.raku:2 ------> when (:⏏$x, :$y) { say $x }
el doesn’t work
Nemokosch m: given x => 1, y => 2 { when :(:$x, :$y) { say $x } } 01:05
Raku eval Exit code: 1 ===SORRY!=== Error while compiling /home/glot/main.raku Variable '$x' is not declared at /home/glot/main.raku:2 ------> when :(:$x, :$y) { say ⏏$x }
Nemokosch it does work, however $x doesn't carry on 01:07
guifa m: given x => 1, y => 2 { say $_ } 01:09
camelia (x => 1 y => 2)
guifa m: given x => 1, y => 2 { .<x>.say } 
camelia Type List does not support associative indexing.
in block <unit> at <tmp> line 1
guifa err
m: given x => 1, y => 2 { %@_<x>.say } 01:11
camelia 1
guifa but plz don't do that because line noise ha
Nemokosch the following code just downright segfaults for me 01:16
m: given x => 1, y => 2 { when (my :(:$x, :$y) := $_) { say 'BLAH' } }
Raku eval Exit code: 1 ===SORRY!=== Error while compiling /home/glot/main.raku Malformed my at /home/glot/main.raku:2 ------> when (my⏏ :(:$x, :$y) := $_) { say 'BLAH' }
Nemokosch (v2022.02 didn't support the syntax yet) 01:17
m: given x => 1, y => 2 { when (my (:$x, :$y) := $_) { say 'BLAH' } }
Raku eval
Nemokosch and this probably does explode for the evalbot as well, couldn't tell by this output xd 01:18
m: given x => 1, y => 2, z => 3 { when my $x := 2 { say 'HMMM' } say $x + $x; } 01:23
Raku eval 4
Nemokosch I'd think this is a bug - why does the when not succeed? 01:24
runs with if
oh right, smartmatching... probably it smartmatches the value of this expression 01:25
m: given x => 1, y => 2, z => 3 { when so my $x := 2 { say 'HMMM' } say $x + $x; } 01:29
Raku eval HMMM
Nemokosch gotcha
m: given x => 1, y => 2, z => 3 { when so 1 == 1 { say '$x' } say so 1 == 1; } 01:30
Raku eval True
Nemokosch this breaks my mind, though
the condition couldn't be truer, it seems 01:30
MasterDuke huh, can repro the segfault. that's a definite bug 01:35
guifa So the line Nemokosch just gave used to work 01:38
m: given x => 1 { when so 1 == 1 { say '$x' }; say so 1 == 1 }
camelia True 01:38
MasterDuke bisectable6: given (x => 1, y => 2) { when (my :(:$x, :$y) := $_) { say "BLAH" } }
bisectable6 MasterDuke, Will bisect the whole range automagically because no endpoints were provided, hang tight
MasterDuke, Output on all releases: gist.github.com/8ebdceda3806df5944...cc5fe4cd10 01:39
MasterDuke, Bisecting by exit signal (old=2022.04 new=2022.06). Old exit signal: 0 (None)
guifa bisectable6: given x => 1 { when so 1 == 1 { say '$x' }; say so 1 == 1 }
bisectable6 guifa, Will bisect the whole range automagically because no endpoints were provided, hang tight
guifa, Output on all releases: gist.github.com/5554349b52600fafbd...9ed7497331 01:40
guifa, Bisecting by output (old=2021.12 new=2022.02) because on both starting points the exit code is 0
guifa ^^ looks like the change happened about a year ago 01:40
el perl be likeperl @_ == 3 or croak "Bad number of arguments";
what will happen if two roles having the same method are added to a class 03:05
rf m: role Foo { method foo { say 'bar'; }; }; role Bar { method foo { say 'baz'; }; }; class Baz is Foo is Bar {}; Baz.new.foo; 03:07
camelia bar
el m:perl role A { sub a() { say ‘A.a’ } } role B { sub a() { say ‘B.a’ } } class C does A, B {} C.a 03:08
Raku eval Exit code: 1 ===SORRY!=== Error while compiling /home/glot/main.raku Unable to parse class definition at /home/glot/main.raku:9 ------> class C does A⏏, B {}
el m:perl role A { sub a() { say ‘A.a’ } } role B { sub a() { say ‘B.a’ } } class C does A does B {} C.a
Raku eval Exit code: 1 No such method 'a' for invocant of type 'C' in block <unit> at main.raku line 11
el m:perl role A { method a() { say ‘A.a’ } } role B { method a() { say ‘B.a’ } } class C does A does B {} C.a 03:09
Raku eval Exit code: 1 ===SORRY!=== Error while compiling /home/glot/main.raku Method 'a' must be resolved by class C because it exists in multiple roles (B, A) at /home/glot/main.raku:9
rf m: role Foo { method foo { say 'bar'; }; }; role Bar { method foo { say 'baz'; }; }; class Baz is Foo, Bar {}; Baz.new.foo;
camelia ===SORRY!=== Error while compiling <tmp>
Unable to parse class definition
at <tmp>:1
------> foo { say 'baz'; }; }; class Baz is Foo⏏, Bar {}; Baz.new.foo;
el yeah it forces you to forward the call to a role 03:10
adding role is does not is 03:11
rf ^
rf: 03:12
m:perl role A { method a() { say ‘A.a’ } } role B { method a() { say ‘B.a’ } } class C does A does B { method a(|c) { self.A.a(|c) } C.a 03:13
Raku eval Exit code: 1 ===SORRY!=== Error while compiling /home/glot/main.raku Missing block at /home/glot/main.raku:14 ------> <BOL>⏏<EOL> expecting any of: statement end statement modifier statement modifier loop
el m:perl role A { method a() { say ‘A.a’ } } role B { method a() { say ‘B.a’ } } class C does A does B { method a(|c) { self.A.a(|c) } } C.a
Raku eval Exit code: 1 No such method 'A' for invocant of type 'C'. Did you mean 'a'? in method a at main.raku line 10 in block <unit> at main.raku line 13
el m:perl role A { method a() { say ‘A.a’ } } role B { method a() { say ‘B.a’ } } class C does A does B { method a(|c) { self::A.a(|c) } } C.a 03:14
Raku eval Exit code: 1 Could not find symbol '&A' in 'GLOBAL::self' in method a at main.raku line 10 in block <unit> at main.raku line 13
el what
help
m:perl role A { method a() { say ‘A.a’ } } role B { method a() { say ‘B.a’ } } class C does A does B { method a(|c) { self.A::a(|c) } } C.a
Raku eval A.a
rf Well, yes and no. You should read about is vs does 03:23
el yes, i mean using does semantics when i ask that question 03:35
is is just multiple inheritance multiple inheritance is funny
lizmat forgot to clickbait rakudoweekly.blog/2023/02/20/2023-...herkining/ yesterday 09:17
sjn gets baited 09:19
Nemokosch by the way, heredoc strings are a nice quality-of-life micro-feature 11:09
from what I see, there is something like this in PHP as well but it seems somwhat more awkward
el heredoc nowdoc 11:34
moritz isn't not really a micro-feature, in the sense that it does make the parser significantly more complicated 12:21
Nemokosch on the other hand it has no runtime impact 12:26
Voldenet heredocs that support tab/space trimming gets it even more complicated 12:28
the syntax in PHP is straight out of perl btw
C# needed 11 versions to get proper heredocs (they called it raw string literals) 12:31
Nemokosch > C# 11 Preview Updates – Raw string literals, UTF-8 and more! 12:33
it seems not only that took them 11 versions...
Voldenet that utf-8 is a not useless, but it's made to win at some benchmarks… 12:35
Nemokosch also, very bluntly put, Raku sacrificed quite a lot of parsing benefits with this approach where you can basically switch to a different sub-language by any token 12:36
so just as much it's good to see the beneficial part of that trade-off, well, any trade-off should have benefits, right?
Voldenet _should_ 12:39
Nemokosch tbh I think these things should also get some showtime. "So you say Raku's grammar is complex and it's hard to inform the user where a certain syntax error could happen? In return, you get a decent remedy to a challenge that gives everybody a headache in pretty much all languages" 12:40
rf Good morning folks 13:54
lizmat rf o/ 13:55
el - complex grammar - no backtracking parser 14:14
Nemokosch this was mentioned not so long ago - actually the latter is decided by the former 14:15
if you want to allow "deviations" (like switching to a slang at any point and then back), backtracking will be too much.... 14:16
the amount of ambiguities and their processing, that does sound like a dangerous road to walk down on 14:17
el so the grammar is too complex for backtracking 14:19
Nemokosch that's one way to put it xD 14:27
shmup can we for the love of camelia rename this bot lol 14:28
good morning y'all :)
moritz good morning shmup. What's wrong with the name? too long for your taste? 15:02
rf m: say 'hello';
camelia hello
rf We already have a camelia :)
shmup haha moritz , i'm so new here i really cannot complain at all! 15:03
i was just waking up, checking irc from mobile, and screaming at columns
proof!!! heh cdn.discordapp.com/attachments/103...G_2742.jpg
it's possible discord is an avilable nick on freenode heh 15:13
lizmat who cares ?
shmup well for starters i absolutely meant to say libera :3 additionally you're right probably, who cares 15:16
lizmat heh, ok :-) 15:18
jdv esp. since on the logs site that is stripped:) 15:21
shmup haha, yes, i should def be controlling this myself. it's a complaint from the PEBCAC section. irssi is good at controllin this sorta thing 15:22
this is a nice boilerplate starting point: github.com/irssi/scripts.irssi.org...shnicks.pl 15:25
shmup quick test 22:03
shmup weeeee i.imgur.com/x5Tcp0K.png 22:04
shmup Nemokosch, say one thing for me, pretty please 22:06
Nemokosch www.youtube.com/watch?v=NuYQWxbYydY 22:07
s/reason/thing/ 22:08
shmup ty. here is the thing for any irssi folks who might be interested :3 github.com/shmup/irssi-scripts/blo...renamer.pl 22:23
i.imgur.com/GUmzCr1.png 22:26
El_Che shmup: interesting... 22:30
tellable6 2023-02-22T21:30:32Z #raku-dev <jdv> El_Che the 2023.02 release happened
[Coke] jdv++. I immediately went to rakubrew to build and install it... and typed 2022.02 22:31
El_Che \o/ 22:32
build the packages tomorrow morning Europe time 22:33
El_Che almost going to bed and I want to avoid a rabbit hole just before :) 22:33
thx for the heads up (and release), jdv! 22:34
jdv nice 22:38
rf Going to rewrite one of my old pet projects in Raku with Humming-Bird :) 22:45
Nemokosch o.O good luck 22:55
lizmat jdv++ 23:16
rf jdv++ 23:25