Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

'state' declarations run their initialization assignments each time, not at START time #11

Open
masak opened this Issue · 0 comments

1 participant

@masak
Owner
<masak> r: sub foo { state $a = 5; state $b = 42; $a++; $b--; say "$a $b" }; foo; foo; foo
<p6eval> rakudo a8086d: OUTPUT«6 41␤7 40␤8 39␤»
<masak> r: sub foo { state ($a, $b) = 5, 42; $a++; $b--; say "$a $b" }; foo; foo; foo
<p6eval> rakudo a8086d: OUTPUT«6 41␤6 41␤6 41␤»
* masak submits rakudobug
<masak> n: sub foo { state ($a, $b) = 5, 42; $a++; $b--; say "$a $b" }; foo; foo; foo
<p6eval> niecza v15-4-g1f35f89: OUTPUT«6 41␤7 40␤8 39␤»
<[Coke]> pugs: sub foo { state ($a, $b) = 5, 42; $a++; $b--; say "$a $b" }; foo; foo; foo
<p6eval> pugs b927740: OUTPUT«6 41␤6 41␤6 41␤»
<[Coke]> :(
* masak submits pugsbug
<[Coke]> danke.
<masak> p: sub foo { state $a = 5; state $b = 42; $a++; $b--; say "$a $b" }; foo; foo; foo
<p6eval> pugs b927740: OUTPUT«6 41␤6 41␤6 41␤»
<masak> Pugs' bug is deeper than Rakudo's. :)

All outputs should be equal to Niecza's.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.