🦋 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: ... | Logs can be inspected at colabti.org/irclogger/irclogger_log/raku
Set by lizmat on 1 May 2021.
00:02 reportable6 left, reportable6 joined
canbenshanlo Playing around with game of life in raku atm. How do i swap shaped arrays? This doesn't work: 00:06
m: my @a[3;3]; my @b[3;3]; (@a, @b) = (@b, @a)
camelia Index 3 for dimension 2 out of range (must be 0..2)
in block <unit> at <tmp> line 1
00:10 rindolf joined 00:12 [Sno] joined
codesections Does [@a, @b] = [@b, @a] do what you want? 00:17
00:17 Black_Ribbon joined
canbenshanlo doesn't seem to be swapping. is it only returning a newly allocated junk of mem? 00:26
00:28 mowcat left
canbenshanlo for ^steps { `my Bool @next[$dim; $dim];` ... @curr = @next; } works for now i guess 00:28
interesting that shaped arrays are so much slower than the manual indexing via $row * $dim + $col. Or maybe my fedora raku package is missing some of the shaped array optimization goodies i've been reading about in the weekly 00:31
newly allocated chunk* 00:34
00:40 MasterDuke left 00:52 lichtkind left 01:34 kvw_5 joined 01:38 kvw_5_ left 01:47 canbenshanlo left 02:01 parv left 02:07 jmcgnh left 02:14 jmcgnh joined 02:22 Henry151 joined 03:00 xelxebar left, xelxebar joined 03:43 synthmeat left 04:10 synthmeat joined
raydiak bisectable6: my @a[1]; my @b[1]; @a = @b; dd @a 04:13
bisectable6 raydiak, Will bisect the whole range automagically because no endpoints were provided, hang tight
raydiak, Output on all releases: gist.github.com/992d291eff8557cba2...474c0e1edd
raydiak, Bisecting by output (old=2019.11 new=2020.01) because on both starting points the exit code is 1
raydiak, bisect log: gist.github.com/888e5e275505a170e1...4faf2943d6 04:14
raydiak, (2020-01-02) github.com/rakudo/rakudo/commit/62...ecef98b6dc
raydiak, Bisecting by exit code (old=2016.10 new=2016.11). Old exit code: 0
raydiak, bisect log: gist.github.com/e739b66f87cfe86a6d...083dc8ccc3
raydiak, (2016-11-09) github.com/rakudo/rakudo/commit/a1...69246719c6
raydiak, ⚠ New output detected, please review the results manually
raydiak, Output on all releases and bisected commits: gist.github.com/092a9a8aa6ab9d4985...625c0e33f8
04:15 japhb left 04:17 japhb joined 04:27 parv joined 05:07 hazim joined 05:38 hazim left 05:40 Sgeo left 05:49 aluaces joined 05:55 wamba joined 06:02 reportable6 left 06:03 reportable6 joined 06:06 maggotbrain left 06:08 maggotbrain joined, brtastic joined 06:12 brtastic1 joined 06:13 brtastic left, brtastic1 is now known as brtastic 06:16 parabolize left 06:47 squashable6 left 06:48 squashable6 joined 06:52 maggotbrain left 06:57 timlegge_ joined 06:59 timlegge left 07:15 codesections left 07:20 codesections joined 07:24 asymptotically joined 07:26 cgfbee left 07:34 cgfbee joined 07:51 domidumont joined 07:52 dakkar joined 08:07 frost-lab joined 08:25 pecastro joined 08:37 brtastic left 09:33 Kaeipi joined 09:34 Merfont left, Kaeipi left 09:35 Kaeipi joined 09:41 Kaeipi left, Kaiepi joined 10:00 asymptotically left 10:07 wamba left, wamba1 joined 10:50 asymptotically joined 10:52 Black_Ribbon left 11:09 brtastic joined
cog_ #vscode 11:15
arf
11:23 parv left 11:35 mowcat joined 11:39 canbenshanlo joined, mowcat left 11:42 mowcat joined 12:01 reportable6 left 12:03 reportable6 joined 12:34 parv joined 13:04 stoned75 joined
stoned75 m: releases Int.^mro(:roles) 13:04
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
releases used at line 1. Did you mean 'reverse', 'repeated'?
stoned75 m: release Int.^mro() 13:05
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
release used at line 1. Did you mean 'reverse'?
stoned75 m: release say "hi"
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
release used at line 1. Did you mean 'reverse'?
stoned75 arf 13:06
commit: releases Int.^mro(:roles)
committable6 stoned75, gist.github.com/e49bd3f34fe24bef5d...a5ed0ac0bf
stoned75 commit: releases Int.^roles(:mro) 13:09
committable6 stoned75, gist.github.com/f45e5350faa893c4af...29f8aac9dd 13:10
13:18 parv left 13:32 parv joined, parv left 13:54 wamba1 left 14:14 frost-lab left 14:38 Sgeo joined 14:54 wamba joined 14:58 parabolize joined 15:51 asymptotically left
tbrowder hi, i’m looking for a practical use for an enum in a signature to express a user’s desire for a particular option. the option should have a default. 15:56
i have written a sub with that use that works, but i see no real advantage over strings and regexes. 15:58
comments? (i’m away from home so i can’t yet show a gist of it). 15:59
lizmat m: $ r 'enum U <FOO BAR BAZ>; sub a(U $a = FOO) { dd $a }; a; a BAR; a 42
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3$7⏏5 r 'enum U <FOO BAR BAZ>; sub a(U $a = F
expecting any of:
infix
infix stopper
statement end
statement …
lizmat m: enum U <FOO BAR BAZ>; sub a(U $a = FOO) { dd $a }; a; a BAR; a 42
camelia U::FOO
U::BAR
Type check failed in binding to parameter '$a'; expected U but got Int (42)
in sub a at <tmp> line 1
in block <unit> at <tmp> line 1
lizmat it would give you a runtime error if you specify something wrong ? 16:00
Altreus That seems like the sort of error that needs repackaging for user display 16:06
Although all errors need repackaging for user display
Lest the user be not speaking of the English
16:16 moon-child left 16:17 asymptotically joined 16:21 moon-child joined 16:27 Black_Ribbon joined 16:28 brtastic left
tbrowder lizmat: thanks! 16:43
16:45 dakkar left 16:53 wamba left 16:59 wamba joined 17:10 clarjon1 joined 17:15 domidumont left
canbenshanlo is there something like .flat(1) in raku? what i'm currently doing: 17:24
m: say (((1,2,3), (4,5,6), (7,8,9))).flat.rotor(3) 17:25
camelia ((1 2 3) (4 5 6) (7 8 9))
tonyo m: say (((1,2,3), (4,5,6), (7,8,9))) 17:27
camelia ((1 2 3) (4 5 6) (7 8 9))
tonyo if you're just want it to flatten use a pipe 17:28
17:28 [Sno] left
moon-child probably want (((1,2,3), (4,5,6), (7,8,9)),) 17:28
tonyo m: say (((1,2,3), (4,5,6), (7,8,9),),)
camelia (((1 2 3) (4 5 6) (7 8 9)))
tonyo m: say |(((1,2,3), (4,5,6), (7,8,9),),)
camelia ((1 2 3) (4 5 6) (7 8 9))
moon-child m: my @x = (((1,2,3), (4,5,6), (7,8,9)),); say @x; say @x.map(&slip) 17:29
camelia [((1 2 3) (4 5 6) (7 8 9))]
((1 2 3) (4 5 6) (7 8 9))
canbenshanlo seems to work. thanks a lot 17:31
17:42 [Sno] joined
moon-child it would be nice if deepmap took a max depth 17:50
codesections I haven't used it much, but would &tree be able to do that with the right arguments? 17:51
moon-child e.g. deepmapping over [[1], [[2, 3], [4, 5]], [[1], 1]] with depth 1 would apply separately to: [1], [2, 3], [4, 5], [[1], 1]
codesections: hmmm 17:53
I'm not sure how you would get 'back' out of the tree representation
tbrowder ref enums and signatures, besides the advantage of type-checking per lizmat above, i refound the cool way to use them is you can smart match without the // on the enum key as well as // on the key OR value. 17:56
let me try to demo.l.. 17:57
i'll post a gist, too much for m 18:00
18:00 cog_ left 18:02 reportable6 left, reportable6 joined 18:53 cog joined 18:59 lucasb joined 19:04 wingfold left 19:09 squashable6 left 19:10 squashable6 joined 19:11 wingfold joined, cog left 19:12 cog joined 19:43 MasterDuke joined 20:05 xelxebar left, xelxebar joined 20:09 caasih left, albino left, rypervenche left, mendel left, spacebat2 left, fvox_ left, perlmaros left, perlmaros joined, mendel joined, caasih joined, rypervenche joined, fvox joined 20:10 albino joined, spacebat2 joined 20:12 pounce left 20:15 pounce joined 20:27 aborazmeh joined 20:28 aborazmeh left 20:33 reario joined, reario left 20:38 MasterDuke left 20:40 mowcat left 20:44 MasterDuke joined 21:00 asymptotically left 21:21 wamba left
gfldex tbrowder: multi sub MAIN(*@input, VideoType :t(:$videotype) = movie, Bool :$verbose) { 21:21
tbrowder: whereby enum VideoType <movie screencast>; 21:22
tbrowder gfldx: roger, thnx 21:23
21:23 stoned75 left
gfldex tbrowder: in case you need more ideas, here is the whole script gist.github.com/gfldex/0497452da51...272e88be98 21:25
tbrowder ah, the given $videotype block shows exactly a cool way to use the enum, thanks 21:29
21:38 MasterDuke left 21:42 stoned75 joined 21:52 stoned75 left 22:37 rindolf left 22:56 pecastro left 23:36 b2gills left 23:51 Black_Ribbon left
canbenshanlo is there a take-while-like method in raku? [3,5,1,2,3].take_while(&:odd?) => [3,5,1] 23:52
ugexe grep + unique 23:57
m: sub odd ($i) { $i !%% 2 }; say [3,5,1,2,3].grep(&odd).unique;
camelia (3 5 1)
canbenshanlo but this still evalutes the whole list, right? 23:59