This channel is intended for people just starting with the Raku Programming Language (raku.org). Logs are available at irclogs.raku.org/raku-beginner/live.html
Set by lizmat on 8 June 2022.
01:43 Manifest0 left 04:40 MasterDuke joined 05:45 hythm joined 06:00 teatime left 06:24 teatime joined 06:37 hythm left 07:00 MasterDuke left 08:38 Manifest0 joined 08:56 dakkar joined
lizmat and yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2023/12/18/2023-...ore-magic/ 13:39
17:46 dakkar left
DarthGandalf Hi, what's the best way to insert a row into a 2d array? When I'm doing @map.splice($index, 0, @map[$index]), it insists on flattening the row to multiple elements, even if I wrap it in [[[]]] 18:33
I found a way: @map.splice($index, 0, 0); @map[$index] = @map[$index+1];
but that looks awkward
actually, it shoudl be @map[$i] = @map[$i+1].Array, otherwise they are apparently shared; but the point of a weird dummy parameter in splice still stands 18:36
19:11 stanrifkin joined
lizmat DarthGandalf: and with @map.splice($index, 0, $@map[$index]) ??? 19:21
m: my @a = 1,2,3; my @b = <a b c>; dd @a.splice(1,0,$@b); dd @a 19:37
camelia Array @a = []
Array @a = [1, "a", "b", "c", 2, 3]
lizmat hmmm that feels like a deficiency in .splice
DarthGandalf: could you please make an issue for this? 19:43
It won't get fixed before the 2023.12 release (too risky with possible ecosystem fallout), but the issue should not fall through the cracks 19:44
Nahita m: my @a = [[12, 3], [4, 5]]; @a.splice(1, 0, [@a[1].clone,]); @a1++; say @a 20:06
Raku eval [[12 3] [4 5 1] [4 5]]
DarthGandalf lizmat: done, github.com/rakudo/rakudo/issues/5500 21:35
Nahita: how does '1' appear in the second row there? 21:36
and @a1 in your code is not even an existing variable 21:37
nemokosch what are you talking about? is this a bridge fault again?
DarthGandalf erm. Could be?
nemokosch yeah it apparently is 21:38
@a[1][2]++ @a1++
DarthGandalf I literally see this (I wonder if bridge bridges it correctly): `m: my @a = [[12, 3], [4, 5]]; @a.splice(1, 0, [@a[1].clone,]); @a1++; say @a <Raku eval> [[12 3] [4 5 1] [4 5]] `
nemokosch the difference between my two expressions is the presence of backticks
DarthGandalf I see 21:39
nemokosch 13[6, 'asd']
I wonder what happens XD
actually, it was [1][2][3][4, 5][6, 'asd'] 21:40
well, good to know at least...