Re: state statements versus state expressions

2012-09-20 Thread Larry Wall
On Tue, Sep 11, 2012 at 10:25:03PM +0100, Nicholas Clark wrote: : On Tue, Sep 11, 2012 at 11:11:11PM +0200, Carl Mäsak wrote: : > Nicholas (>): : > > Where in the synopses (or other documents) does it explain why these two : > > are different? : > > : > > $ ./perl6 -e 'sub foo {state @a = (3, 4); s

Re: state statements versus state expressions

2012-09-11 Thread Nicholas Clark
On Tue, Sep 11, 2012 at 11:11:11PM +0200, Carl Mäsak wrote: > Nicholas (>): > > Where in the synopses (or other documents) does it explain why these two > > are different? > > > > $ ./perl6 -e 'sub foo {state @a = (3, 4); say ++@a[0];}; foo; foo;' > > 4 > > 5 > > $ ./perl6 -e 'sub foo {(state @a) =

Re: state statements versus state expressions

2012-09-11 Thread Carl Mäsak
Nicholas (>): > Where in the synopses (or other documents) does it explain why these two > are different? > > $ ./perl6 -e 'sub foo {state @a = (3, 4); say ++@a[0];}; foo; foo;' > 4 > 5 > $ ./perl6 -e 'sub foo {(state @a) = (3, 4); say ++@a[0];}; foo; foo;' > 4 > 4 S03:4912. "Each declarator can t

state statements versus state expressions

2012-09-11 Thread Nicholas Clark
Where in the synopses (or other documents) does it explain why these two are different? $ ./perl6 -e 'sub foo {state @a = (3, 4); say ++@a[0];}; foo; foo;' 4 5 $ ./perl6 -e 'sub foo {(state @a) = (3, 4); say ++@a[0];}; foo; foo;' 4 4 (I'm pretty sure that I remember that they intentionally *are*