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

state $x //= ... doesn't work #1106

Closed
p6rt opened this issue Jun 28, 2009 · 4 comments
Closed

state $x //= ... doesn't work #1106

p6rt opened this issue Jun 28, 2009 · 4 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Jun 28, 2009

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

Searchable as RT67040$

@p6rt
Copy link
Author

p6rt commented Jun 28, 2009

From @moritz

20​:11 <@​moritz_> rakudo​: sub a { state $x //= 3; $x++; say $x }; a(); a()
20​:12 < p6eval> rakudo 6c43f9​: OUTPUT«4␤4␤»

Although that's better written as 'state $x = 3', it should IMHO give
the result 4\n5\n, not 4\n4\n

Cheers,
Moritz

@p6rt
Copy link
Author

p6rt commented Jun 30, 2009

From @jnthn

On Sun Jun 28 12​:05​:28 2009, moritz wrote​:

20​:11 <@​moritz_> rakudo​: sub a { state $x //= 3; $x++; say $x }; a(); a()
20​:12 < p6eval> rakudo 6c43f9​: OUTPUT«4␤4␤»

Although that's better written as 'state $x = 3', it should IMHO give
the result 4\n5\n, not 4\n4\n

Aye, agree. And after git 95a2c4f it now does.

sub a { state $x //= 3; $x++; say $x }; a(); a()
4
5

Plus spectest for //= and state interaction unfudged.

Thanks,

Jonathan

@p6rt
Copy link
Author

p6rt commented Jun 30, 2009

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

@p6rt
Copy link
Author

p6rt commented Jun 30, 2009

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

@p6rt p6rt closed this as completed Jun 30, 2009
@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant