[perl #56976] [TODO] implement state variables

2009-03-17 Thread jn...@jnthn.net via RT
On Wed Jul 16 01:47:29 2008, mor...@casella.verplant.org wrote: State variables need to be implemented, the tests are already there in S04-declarations/state.t As a side node (and related to RT #56748), rakudo as of r29490 gives a bogus error message when encountering a state declaration:

[perl #56976] [TODO] implement state variables

2009-03-17 Thread jn...@jnthn.net via RT
On Wed Jul 16 01:47:29 2008, mor...@casella.verplant.org wrote: State variables need to be implemented, the tests are already there in S04-declarations/state.t As a side node (and related to RT #56748), rakudo as of r29490 gives a bogus error message when encountering a state declaration:

Re: [perl #56976] [TODO] implement state variables

2009-03-17 Thread Nicholas Clark
On Tue, Mar 17, 2009 at 09:19:55AM -0700, jn...@jnthn.net via RT wrote: On Wed Jul 16 01:47:29 2008, mor...@casella.verplant.org wrote: State variables need to be implemented, the tests are already there in S04-declarations/state.t As a side node (and related to RT #56748), rakudo as of

Re: [perl #56976] [TODO] implement state variables

2009-03-17 Thread Jonathan Worthington
Nicholas Clark wrote: Do you have list assignment working properly? ie: state (@foo) = @bar; and, I think, state (@foo) = baz(); Aye, thankfully that just fell naturally out of Rakudo's existing list assignment implementation, though it was under-tested. So I just added: my

Re: [perl #56976] [TODO] implement state variables

2009-03-17 Thread Nicholas Clark
On Tue, Mar 17, 2009 at 05:59:52PM +0100, Jonathan Worthington wrote: Nicholas Clark wrote: Do you have list assignment working properly? ie: state (@foo) = @bar; and, I think, state (@foo) = baz(); Aye, thankfully that just fell naturally out of Rakudo's existing list

Re: [perl #56976] [TODO] implement state variables

2009-03-17 Thread Jonathan Worthington
Nicholas Clark wrote: Yay. As does this? my @bar = 1,2,3; sub swatest { (state @foo) = @bar; my $x = @foo.perl; @foo[0]++; return $x } is swatest(), '[1, 2, 3]', 'array state initialized correctly'; is swatest(), '[1, 2, 3]', 'array state retained

Re: [perl #56976] [TODO] implement state variables

2009-03-17 Thread Moritz Lenz
Nicholas Clark via RT wrote: On Tue, Mar 17, 2009 at 05:59:52PM +0100, Jonathan Worthington wrote: Nicholas Clark wrote: Do you have list assignment working properly? ie: state (@foo) = @bar; and, I think, state (@foo) = baz(); Aye, thankfully that just fell naturally

Re: [perl #56976] [TODO] implement state variables

2009-03-17 Thread Nicholas Clark
On Tue, Mar 17, 2009 at 06:45:51PM +0100, Jonathan Worthington wrote: Nicholas Clark wrote: Yay. As does this? my @bar = 1,2,3; sub swatest { (state @foo) = @bar; my $x = @foo.perl; @foo[0]++; return $x } is swatest(), '[1, 2, 3]', 'array state

Re: [perl #56976] [TODO] implement state variables

2009-03-17 Thread Jonathan Worthington
Nicholas Clark wrote: On Tue, Mar 17, 2009 at 06:45:51PM +0100, Jonathan Worthington wrote: Nicholas Clark wrote: Yay. As does this? my @bar = 1,2,3; sub swatest { (state @foo) = @bar; my $x = @foo.perl; @foo[0]++; return $x } is swatest(), '[1, 2, 3]',

[perl #56976] [TODO] implement state variables

2008-07-16 Thread via RT
# New Ticket Created by Moritz Lenz # Please include the string: [perl #56976] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=56976 State variables need to be implemented, the tests are already there in