On Sat Oct 16 12:53:02 2010, masak wrote:
> <masak> rakudo: for ^8 { say .fmt("%03b") }
> <p6eval> rakudo 064702: OUTPUT«000001010011100101110111»
> <masak> rakudo: for ^8 { .=fmt("%03b"); .say }
> <p6eval> rakudo 064702: OUTPUT«000Cannot modify readonly value in
> '&infix:<=>' [...]
> <masak> bug or not? why does it die on the second iteration?
> <masak> rakudo: for ^8 -> $_ is copy { .=fmt("%03b"); .say }
> <p6eval> rakudo 064702: OUTPUT«000001010011100101110111»
> <colomon> could it somehow be checking what the value already was?
> <colomon> rakudo: for ^8 { $_ = 0; .say }
> <p6eval> rakudo 064702: OUTPUT«0Cannot modify readonly value in
> '&infix:<=>' [...]
> <colomon> rakudo: for 0, 0, 0 { $_ = 0; .say }
> <p6eval> rakudo 064702: OUTPUT«Cannot modify readonly value in
> '&infix:<=>' [...]
> <colomon> ???????
> <colomon> still have no clue why the bug
> <masak> so you agree it's a bug?
> <colomon> seems like it's got to be, one way or the other.
> * masak submits rakudobug
> <colomon> I mean, either going through the loop the first time is
> wrong, or not going through it the second time is.
> <colomon> unless there's something really subtle and disturbing going
on.
Now it (properly, I think), dies on the first iteration:
17:05 < [Coke]> rakudo: for ^8 { .=fmt("%03b"); .say }
17:05 <+p6eval> rakudo 33f1cf: OUTPUT«Cannot assign to a non-container
in
method dispatch:<.=> at src/gen/CORE.setting:714 in
block
<anon> at /tmp/fh4hsVBFkr:1 in method reify at
src/gen/CORE.setting:3755 in method reify at
src/gen/CORE.setting:3660 in method reify at
src/gen/CORE.setting:366…
Closable with tests.
--
Will "Coke" Coleda