Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readonly error on *second iteration* in Rakudo!? #2227

Closed
p6rt opened this issue Oct 16, 2010 · 5 comments
Closed

Readonly error on *second iteration* in Rakudo!? #2227

p6rt opened this issue Oct 16, 2010 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Oct 16, 2010

Migrated from rt.perl.org#78406 (status was 'resolved')

Searchable as RT78406$

@p6rt
Copy link
Author

p6rt commented Oct 16, 2010

From @masak

<masak> rakudo​: for ^8 { say .fmt("%03b") }
<p6eval> rakudo 064702​: OUTPUT«000␤001␤010␤011␤100␤101␤110␤111␤»
<masak> rakudo​: for ^8 { .=fmt("%03b"); .say }
<p6eval> rakudo 064702​: OUTPUT«000␤Cannot 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«000␤001␤010␤011␤100␤101␤110␤111␤»
<colomon> could it somehow be checking what the value already was?
<colomon> rakudo​: for ^8 { $_ = 0; .say }
<p6eval> rakudo 064702​: OUTPUT«0␤Cannot 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.

@p6rt
Copy link
Author

p6rt commented Oct 8, 2011

From @coke

On Sat Oct 16 12​:53​:02 2010, masak wrote​:

<masak> rakudo​: for ^8 { say .fmt("%03b") }
<p6eval> rakudo 064702​: OUTPUT«000␤001␤010␤011␤100␤101␤110␤111␤»
<masak> rakudo​: for ^8 { .=fmt("%03b"); .say }
<p6eval> rakudo 064702​: OUTPUT«000␤Cannot 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«000␤001␤010␤011␤100␤101␤110␤111␤»
<colomon> could it somehow be checking what the value already was?
<colomon> rakudo​: for ^8 { $_ = 0; .say }
<p6eval> rakudo 064702​: OUTPUT«0␤Cannot 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

@p6rt
Copy link
Author

p6rt commented Oct 8, 2011

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jan 4, 2013

From @moritz

Tested in S04-statements/for.t

@p6rt
Copy link
Author

p6rt commented Jan 4, 2013

@moritz - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant