🦋 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.
00:02 reportable6 left 00:03 coleman-x left, coleman-x joined 00:04 reportable6 joined 00:16 bigboi joined, bigboi left 00:22 evalable6 joined 00:45 tejr left 01:24 linkable6 joined 02:04 xinming_ left, xinming_ joined
perryprog Oh my goodness... how have I not seen this: www.ozonehouse.com/mark/periodic/ 02:23
02:56 holyghost joined 03:26 xinming_ left 03:27 xinming_ joined 04:18 xinming_ left, xinming_ joined 04:23 Eddward_ left 05:18 kjp_ is now known as kjp 05:43 abraxxa left 06:02 reportable6 left 06:03 Xliff_ joined 06:04 Xliff_ joined 06:05 perlmaros_ joined, lucerne9 joined, abraxxa joined 06:06 lucerne left, ericdm2 joined, bartolin joined, japhb_ joined 06:07 clarjon_1 joined, avar joined 06:09 elcaro_ joined 06:10 peder_ joined, jdv_ joined 06:13 jercos_ joined, thowe_ joined, tobs` joined 06:14 Grrrr left, timo left, jargan left, Xliff left, peder left, lizmat left, broquaint left, clarjon1 left, MasterDuke left, dustinm` left, japhb left, ericdm left, lucerne left, avarab left, chronon left, thowe left, a3r0 left, tobs left, jercos left, ilogger2 left, elcaro left, perlmaros left, casaca left, Util left, markmarkmark left, bartolin_ left, raydiak left, masak left, jdv left, ericdm2 is now known as ericdm, lucerne9 is now known as lucerne, tobs` is now known as tobs, broquain1 joined, perlmaros_ is now known as perlmaros, peder_ is now known as peder, a3r0_ joined 06:15 timo joined 06:16 masak joined, jargan joined, lizmat joined, dustinm` joined, chronon joined, Grrrr joined 06:17 Util joined, ufobat_ joined 06:19 markmarkmark joined 06:20 raydiak joined, ufobat_ left 06:25 ilogger2 joined 06:27 dustinm` left, dustinm` joined 06:38 patrickb joined 06:49 jast joined 06:50 jargan left 07:03 reportable6 joined 07:12 broquain1 left, avar left, broquaint joined 07:14 avar joined 07:16 Kaipi joined 07:18 shareable6_ joined 07:21 shareable6 left, Kaiepi left, tellable6 left, tellable6 joined 07:22 childlikempress joined, moon-child left, childlikempress is now known as moon-child 07:24 immediate joined, samebchase9 joined 07:25 committable6_ joined, notable6_ joined 07:26 ecocode__ joined, xkr47_ joined 07:27 notable6 left, committable6 left, ecocode_ left, samebchase left, xkr47 left, xkr47_ is now known as xkr47 07:31 samcv_ joined
immediate hi, why doesn't `substr` without arguments fail directly but hang 07:33
07:33 Henry151_ joined, Sgeo left
immediate m: "this".substr 07:33
camelia MoarVM panic: Memory allocation failed; could not allocate 157600 bytes
07:34 jjido joined
immediate isn't the first parameter mandatory 07:34
07:34 samcv left, Henry151 left
moon-child immediate: looks like bug 07:34
j 07:35
found the culprit. Cool.substr with no args forwards to Str.substr with no args, but that is not a thing 07:39
github.com/rakudo/rakudo/pull/4544 PR'd fix 07:43
07:43 Name joined, Name is now known as Guest4024
moon-child (actually I'm kinda surprised it OOM'd. Guessing there's no TCO to mmaintain tracebacks?) 07:45
07:46 clarjon_1 left
immediate moon-child: thanks for the fix :d 07:46
08:09 Guest4024 is now known as clarjon1
immediate But `"this"` is already a string why that method should be called? 08:11
m: say "this".^mro
camelia ((Str) (Cool) (Any) (Mu))
immediate ah okay because there is no matching candidate in Str's methods, sorry 08:14
moon-child Str does Cool, for obvious reasons. Str defines a number of substr candidates, all of which take one or two parameters. Cool defines substr candidates of one and two parameters, which look like: multi method substr(Cool:D: \x) { self.Str.substr(x) }. Normally those will never get selected for an actual Str, but for an Int, it is converted to a Str and substr is called on the resulting Str
oh you got it...ninja'd! 08:15
immediate :d
lizmat the problem is the missing Str.substr candidate.... fixing now
moon-child oh, there _should_ be a zero-argument Str.substr?
what's it do, return self?
08:16 elcaro_ left, elcaro joined
moon-child m: proto f(|) returns Int {*}; multi f($x) returns Str { ';o' }; say f 5 08:17
camelia ;o
moon-child why is ^^ legal?
08:17 jdv_ left, jdv joined
lizmat moon-child: I'd say that should be a compile time error 08:18
moon-child yeah. But even if not compile time, why not run time? 08:19
(and still passes if I leave off the return type on the multi candidate--it's not inherited from the proto. Should I file a bug report?)
lizmat moon-child: pretty sure it will be a run-time error if you make the proto something other than {*} 08:21
08:21 abraxxa left 08:23 jjido left
moon-child what else can I make it that lets the other candidate run? 08:23
hmm, docs.raku.org/syntax/proto has examples with multis returning something other than the proto. So intended maybe? 08:25
lizmat m: proto foo(--> Int) { say "foo"; {*} }; multi foo(--> Str) { "bar" }; foo()
camelia foo
Type check failed for return value; expected Int but got Str ("bar")
in sub foo at <tmp> line 1
in block <unit> at <tmp> line 1
lizmat moon-child: I think the problem is that the compiler assumes it can ignore the proto if it only consists of {*} 08:26
08:29 bloatable6 left, bisectable6 left
moon-child that makes sense! 08:29
08:30 bloatable6 joined, bisectable6 joined
moon-child anyway ix.io/3Au6/perl6 demonstration of multis being less dangerous than methods 08:30
though hmmm, it works if I make it a multi method! 08:31
however that requires the child class to declare it as a multi method. So it is easy to bypass. You can't express the constraint entirely in the parent role 08:32
08:40 Kaipi left, holyghost left 08:42 broquaint left, corwin left, broquain1 joined, Kaiepi joined, corwin joined, reportable6 left, perlbot left
lizmat moon-child: please make an issue for the proto / multi return constraint you found 08:43
08:43 reportable6 joined, perlbot joined, GreaseMonkey left, synthmeat left, synthmeat joined 08:44 greaser|q joined
moon-child done! I assume the class method behaviour is intentional? 08:46
08:47 xkr47 left, xkr47 joined 08:55 linkable6 left 09:07 jdv left, jdv joined 09:08 masak_ joined, masak left 09:11 avarab joined 09:12 jdv_ joined 09:14 avar left, chronon left, elcaro left, jdv left, elcaro joined, moon-child left, moon-child joined 09:16 chronon joined 09:43 immediate left 10:24 casaca joined 10:48 Altai-man joined, immediate joined 10:56 linkable6 joined 10:59 linkable6 left 11:00 linkable6 joined 11:39 holyghost joined 11:53 holyghost left 12:03 reportable6 left, reportable6 joined 12:15 abraxxa joined, rypervenche left 12:19 abraxxa left 12:20 abraxxa joined 12:29 japhb_ is now known as japhb, rypervenche joined 12:35 abraxxa left 12:54 Maylay left 13:02 Maylay joined 13:17 holyghost joined 13:25 [Coke] is now known as CokeZero, CokeZero is now known as [Coke] 14:12 Sgeo joined 14:21 holyghost left 14:33 jjido joined 14:39 jjido left 14:48 ericdm left 15:10 anser joined 15:12 anser left, anser joined 15:15 anser left, anser joined, anser left 15:16 anser joined 15:20 anser left 15:55 immediate left 16:18 MasterDuke joined 16:31 coleman-x left 16:50 slu joined 17:09 linkable6 left 17:12 djerius left 17:13 djerius joined 17:23 patrickb left 17:34 Altai-man left 17:54 phogg left, phogg joined 18:00 Henry151_ is now known as Henry151 18:03 reportable6 left 18:07 jess left 18:10 linkable6 joined 18:12 jjido joined 18:22 jess joined
Voldenet m: say (20/3) div 2 18:34
camelia Cannot resolve caller infix:<div>(Rat:D, Int:D); none of these signatures match:
(Int:D $a, Int:D $b --> Int:D)
(int $a, int $b --> int)
in block <unit> at <tmp> line 1
Voldenet m: multi sub infix:<div> { ($^a - $^a % $^b) / $^b }; say (20/3) div 2
camelia 3
Voldenet I wish it was already defined
18:36 melezhik joined
melezhik . 18:36
tellable6 2021-09-29T23:37:04Z #raku <tbrowder> melezhik try Inline::Perl5 with Perl modules from GraphicsMagick
melezhik tbrowder thanks 18:37
hi! I have started to test a water with open source project contest on mybfio, not sure if it matches Raku as current eco system is still not big, anyway here is the link - mybf.io/contest 18:38
I'd appreciate for comments
18:38 abraxxa-home joined 18:51 jjido left 18:55 immediate joined 18:56 melezhik left 19:04 reportable6 joined
[Coke] 4 19:19
19:20 slu left 19:52 abraxxa-home left 20:43 jjido joined 20:56 jjido left 21:05 immediate left 21:39 gordonfish- joined 21:41 gordonfish left 21:42 gordonfish- is now known as gordonfish 21:44 chloekek joined
chloekek m: say ‘哈’ x 10 21:46
camelia 哈哈哈哈哈哈哈哈哈哈
22:35 greaser|q left, greaser|q joined, greaser|q is now known as GreaseMonkey 23:32 gordonfish left 23:33 gordonfish joined