🦋 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.
HrBollermann i need advice. how could i remove the wetness in the grammar? 09:33
www.reddit.com/r/adventofcode/comm...?context=3
i mean the 5 lines that are basically the same, I feel I should be able to abtract those 09:34
MasterDuke moritz_ is the person to ask 09:36
HrBollermann summons the arcane underscore devourer 09:42
moritz_ wetness? 10:19
all I can say is that the grammar engine isn't doing a lot of work there, so going without it might be easier :D 10:34
one could try to generalize the various parens matchers, something like token paired($open, $close) { $open { $*rep.push: $close } ~ $close <balanced> { $*rep.pop } } 10:35
dunno if that works
mscha m: my @foo = 0,0,0,0,0; say all @foo == 0 ?? 'OK' !! 'Huh?'; 10:37
camelia all(Huh?)
mscha m: my @foo = 0,0,0,0,0; say all(@foo) == 0 ?? 'OK' !! 'Huh?'; 10:38
camelia OK
mscha Ah.
HrBollermann @moritz_ wetness, as in repeated patterns in code. as in not being DRY 10:42
moritz_ yeah, what I said, either try a parameterized token, or get rid of the grammar 11:13
HrBollermann i seem to be too daft to figure out how to call the token 11:19
dpk m: "\u0300" ~~ /:ignoremark ^ $/ 11:50
camelia 5===SORRY!5=== Error while compiling <tmp>
Unrecognized backslash sequence: '\u'
at <tmp>:1
------> 3"\7⏏5u0300" ~~ /:ignoremark ^ $/
expecting any of:
double quotes
statement list
term
dpk m: "́" ~~ /:ignoremark ^ $/ 11:52
camelia 5===SORRY!5=== Error while compiling <tmp>
Bogus statement
at <tmp>:1
------> 3<BOL>7⏏5"́" ~~ /:ignoremark ^ $/
expecting any of:
prefix
statement list
term
dpk m: say "́" ~~ /:ignoremark ^ $/
camelia 5===SORRY!5===
Argument to "say" seems to be malformed
at <tmp>:1
------> 3say7⏏5 "́" ~~ /:ignoremark ^ $/
Bogus postfix
at <tmp>:1
------> 3say 7⏏5"́" ~~ /:ignoremark ^ $/
expecting any of:
infix
dpk m: say "" ~~ /:ignoremark ^ $/
camelia 「」
dpk m: say "\x301" ~~ /:ignoremark ^ $/ 11:54
camelia Nil
dpk m: say "\x301" ~~ /:ignoremark ./ 11:55
camelia 「́」
dpk m: say "\x301" ~~ /:ignoremark ''/
camelia 「」
dpk m: say "\x301" ~~ /:ignoremark ^ '' $/
camelia Nil
a_friend quick question: how do i forward declare a class? 12:24
El_Che I would use roles 12:30
lizmat a_friend: to answer the question: 12:33
m: class A { ... }; class A { has $.foo = 42 }; dd A.new 12:34
camelia A.new(foo => 42)
lizmat but as El_Che said: you should probably think about using roles if you can
a_friend i see, thanks for the help 12:38
i had seen the stackoverflow answer to this question and assumed that "..." was some pseudocode
it appears that "..." is some actual syntax
lizmat no, it's the "yada yada yada" operator :-) 12:38
El_Che docs.raku.org/language/glossary#Stub 12:39
docs.raku.org/language/glossary#Abstract_class
Xliff Does anyone here have a link to a talk by someone who was positioning Raku as a language for Quantum Computing? 18:16
Was it Randal?
Ah! Damian! 18:17
Xliff Here's one: www.youtube.com/watch?v=ORjyXcLDd9M&loop=0 18:22
HrBollermann yo 23:42