🦋 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 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 8 June 2022.
00:07 reportable6 left 00:09 reportable6 joined 00:30 lichtkind left 02:07 xinming left 02:09 xinming joined 02:16 xinming left, xinming joined 02:32 clarjon1 left
MadcapJake m: class A { has $.name; has &.block; submethod BUILD(:$!name, :&!block) {} }; my %as = alpha => A.new :name<alpha> :block(->{}), beta => A.new :name<beta> :block(->{}); my Map $m := Map.new(%as.values>>.name Z %as.values>>.block); $m.WHAT.say; $m<alpha>.say; $m<alpha> = 'foo'; $m<alpha>.say; 02:55
Voldenet m: class A { has $.name; has &.block; submethod BUILD(:$!name, :&!block) {} }; my %as = alpha => A.new :name<alpha> :block(->{}), beta => A.new :name<beta> :block(->{}); my Map $m := Map.new(%as.values>>.name Z %as.values>>.block); $m.WHAT.say; $m<alpha>.say; $m<alpha> = 'foo'; $m<alpha>.say; 02:56
camelia (Map)
-> { #`(Block|4932231743384) ... }
foo
02:56 discord-raku-bot left 02:57 discord-raku-bot joined 03:01 discord-raku-bot left 03:02 discord-raku-bot joined 03:07 discord-raku-bot left, discord-raku-bot joined 04:01 Kaiepi joined 04:56 avuserow left 05:00 Sankalp left, Sankalp joined 06:00 sourceable6 left, quotable6 left, tellable6 left, coverable6 left, statisfiable6 left, notable6 left, committable6 left, evalable6 left, nativecallable6 left, reportable6 left, shareable6 left, bisectable6 left, greppable6 left, releasable6 left, linkable6 left, unicodable6 left, bloatable6 left, benchable6 left 06:01 shareable6 joined, linkable6 joined, notable6 joined 06:02 bisectable6 joined, releasable6 joined, sourceable6 joined, unicodable6 joined, bloatable6 joined, nativecallable6 joined, tellable6 joined, frost joined, benchable6 joined 06:03 greppable6 joined, coverable6 joined, statisfiable6 joined, evalable6 joined, committable6 joined 06:04 quotable6 joined, reportable6 joined 06:05 Kaiepi left 06:09 Kaiepi joined 06:37 Sankalp left 06:41 Sankalp joined 06:57 Sgeo left 06:58 Sgeo joined 06:59 Kaiepi left 07:12 Kaiepi joined 07:16 clarjon1 joined 07:19 Garbanzo left 07:27 Sgeo left 07:59 jrjsmrtn_ left 08:00 jrjsmrtn joined 08:21 ProperN[out] left 08:22 ProperNoun joined 09:08 lichtkind joined 10:04 lichtkind_ joined 10:06 lichtkind left 10:18 Xliff joined 10:21 linkable6 left, linkable6 joined 10:39 bbrtj joined 11:39 linkable6 left, evalable6 left 11:40 evalable6 joined 11:41 linkable6 joined 12:01 frost left 12:02 frost joined 12:06 reportable6 left 12:08 reportable6 joined 12:16 frost left 13:10 Xliff left 14:09 jaguart joined 14:23 jgaz joined 15:00 jgaz left
sienet_ja_LSD[m] why is it that JSON parse fails in every third run? 15:20
15:21 jgaz joined
lizmat sienet_ja_LSD[m]: do you have a golf for that ? 15:21
sienet_ja_LSD[m] I run the script and it works fine like 2 out of 3 times, and then one in 3 it's Type check failed in binding to parameter '%case'; expected Associative but got Any (Any)
golf? 15:22
lizmat the smallest piece of code that shows the problem
sienet_ja_LSD[m] I can upload
lizmat please 15:24
sienet_ja_LSD[m] ix.io/40WL 15:26
^ 15:27
lizmat looks like the JSON is really at raw.githubusercontent.com/exercism...-data.json :-) 15:29
sienet_ja_LSD[m] yes that one but I downloaded it and renamed it bob.json
anyway it fails 15:30
it works but fails, unpredictably
lizmat yeah, confirmed it fails
feels like some race condition deep in the internals :-(
sienet_ja_LSD[m] hmm ok 15:31
lizmat could you make a Rakudo issue for that? 15:32
sienet_ja_LSD[m] yeah sure
lizmat thanks!
ah... I think I have a hunch it's not a system issue after all 15:35
sienet_ja_LSD[m] it's fixable? 15:36
lizmat well... where did you derive the [1] in .List[1] from ? 15:37
sienet_ja_LSD[m] I just wanted the second entry, there's only two. [0] is description and [1] an array of cases 15:38
lizmat ah, but the outer structure in the JSON is a hash, and the order of keys in a hash is indeterminate
sienet_ja_LSD[m] hmm figures 15:39
yeah true :D
by removing the list method it seems to work 15:40
thanks 15:41
lizmat as a one liner: 15:43
say .<description> for from-json("bob.json".IO.slurp)<cases>.list;
15:47 jgaz left 16:47 coverable6 left, sourceable6 left, shareable6 left, notable6 left, quotable6 left, evalable6 left, bisectable6 left, reportable6 left, tellable6 left, committable6 left, benchable6 left, linkable6 left, bloatable6 left, nativecallable6 left, unicodable6 left, releasable6 left, greppable6 left, statisfiable6 left, coverable6 joined 16:48 bisectable6 joined, unicodable6 joined, notable6 joined, benchable6 joined, statisfiable6 joined, quotable6 joined, shareable6 joined 16:49 reportable6 joined, evalable6 joined, linkable6 joined, greppable6 joined, releasable6 joined, sourceable6 joined 16:50 tellable6 joined, nativecallable6 joined, bloatable6 joined, committable6 joined 17:19 jaguart left 17:56 Garbanzo joined 17:57 bdju left 18:06 reportable6 left 18:08 reportable6 joined 18:12 Sgeo joined
gfldex is there any way to protect a class from being exported? 18:33
Found one. Sadly, I already started with the blogpost and I have no idea how to explain what I'm doing. :) 18:40
19:12 evalable6 left, linkable6 left, linkable6 joined 19:13 bdju joined 19:14 evalable6 joined
gfldex lolibloggedalittle: gfldex.wordpress.com/2022/06/26/sinking-errors/ 19:16
uzl[m] m: say min [1, 2, 3], {1/$} 19:25
camelia -> ;; $_? is raw = OUTER::<$_> { #`(Block|2800384389576) ... }
uzl[m] m: say min [1, 2, 3], by => {1/$}
camelia Use of uninitialized value of type Any in numeric context
1
in block at <tmp> line 1
Use of uninitialized value of type Any in numeric context
in block at <tmp> line 1
Use of uninitialized value of type Any in numeric context
in bl…
uzl[m] m: say min 1, 2, 3, by => {1/$} 19:27
camelia Use of uninitialized value of type Any in numeric context
1
in block at <tmp> line 1
Use of uninitialized value of type Any in numeric context
in block at <tmp> line 1
Use of uninitialized value of type Any in numeric context
in bl…
uzl[m] m: say min(1,7,3,:by( { 1/$_ } ));
camelia 7
uzl[m] m: say (1, 7, 3).min({1/$_}) 19:28
camelia 7
uzl[m] I was just going to ask why the asymmetry between the function and method calls for `min` and `max` when passing a callable but I now realize it makes sense. If you passed the callable as a positional parameter in the function call, then it'd be considered just another value 😅 19:31
m: say min 1, 2, 3, by => {1/$}
camelia Use of uninitialized value of type Any in numeric context
1
in block at <tmp> line 1
Use of uninitialized value of type Any in numeric context
in block at <tmp> line 1
Use of uninitialized value of type Any in numeric context
in bl…
uzl[m] m: say min 1, 2, 3, :by({1/$}) 19:32
camelia Use of uninitialized value of type Any in numeric context
1
in block at <tmp> line 1
Use of uninitialized value of type Any in numeric context
in block at <tmp> line 1
Use of uninitialized value of type Any in numeric context
in bl…
uzl[m] m: say min(1, 2, 3, :by({1/$}))
camelia Use of uninitialized value of type Any in numeric context
1
in block at <tmp> line 1
Use of uninitialized value of type Any in numeric context
in block at <tmp> line 1
Use of uninitialized value of type Any in numeric context
in bl…
uzl[m] m: say min 1, 2, 3, :by({1/$_}) 19:33
camelia 3
uzl[m] m: say min 1, 2, 3, by => {1/$_}
camelia 3
20:01 avuserow joined 20:45 sena_kun left 20:46 sena_kun joined 21:31 jgaz joined 21:37 jgaz left 22:20 perlbot left, simcop2387 left 22:49 tejr left 22:55 tejr joined
Geth modules.raku.org: zoffixznet++ created pull request #144:
s/perl6/raku/ in site tips
23:12
SmokeMachine I got it right? Is Zoffix back?! 23:14
uzl[m] It seems like it 👍️ 23:28
23:33 simcop2387 joined
SmokeMachine \o/ 23:33
23:34 perlbot joined 23:41 perlbot left, simcop2387 left 23:47 simcop2387 joined 23:49 perlbot joined 23:53 simcop2387 left 23:55 perlbot left