$ cat /tmp/test
class M {
has M @.ms is rw;
method s($i=0) {
$i ~ "[{ map { "{$_.s($i + 1)}" }, self.ms }]"
}
}
my $m = M.new;
my $m2 = M.new;
$m2.ms = M.new;
$m.ms = M.new, $m2, M.new;
say $m.s;
$ perl6 /tmp/test
0[1[] 2[3[]] 4[]]
# expected output:
# 0[1[] 1[2[]] 1[]]
<masak> jnthn: did you fix my bug yet?
<jnthn> masak: no.
<jnthn> ENEEDMORECOFFEE
<jnthn> I looked at it, and then ran to the coffee machine. :-)
<masak> lol
* moritz_ also found it a bit hard to follow :-)
<masak> I think by golfing it I actually made it harder to follow. :/
<masak> when it was about indentation, it was immediate that it was wrong.
<moritz_> or if you gave them names (<a b c d e>) and print that along
with the number
<masak> the structure looks like this: Ma[Mb, Mc[Md], Me]
<masak> now, Mb and Me should be printed with the same indentation/number.
<jnthn> masak: ugh
<masak> but they aren't.
<jnthn> masak: Yes, I see the bug now.
* masak submits rakudobug
<jnthn> I agree it's wrong.
<masak> rakudo: sub f(@a, $i=0) { $i ~ "[{map { f($_, $i + 1) }, @a}]" }; say f([[], [[]], []])
<p6eval> rakudo 7347ec: 0[1[] 2[3[]] 4[]]
* masak adds that to #70469
<pmichaud> masak: I suspect that's related to dispatch/binder changes, but that's just a
guess.
<masak> pmichaud: same here.
<jnthn> Me too now I see it as a sub example.
<jnthn> masak: Default param to blame?
<masak> jnthn: I'll check.
<masak> rakudo: sub f(@a, $i) { $i ~ "[{map { f($_, $i + 1) }, @a}]" }; say f([[], [[]], []], 0)
<p6eval> rakudo 7347ec: 0[1[] 2[3[]] 4[]]
<masak> jnthn: no.
<jnthn> masak: Aww.
<moritz_> masak: dammit. I was just about to put it into S06-signature/defaults.t
<jnthn> lol
<masak> :)
<pmichaud> looks to me as though a new lexpad isn't being created somehow.
<jnthn> Yeah, the problem is in there somehow.
<moritz_> masak: and now I realize it's the wrong place, and I have no clue where to put it
<masak> moritz_: sorry :D