in reply to Re^5: Experimental features: autoderef vs postfix deref
in thread Experimental features: autoderef vs postfix deref
While I agree that:
{ my $state_var; sub foo { ...; } sub bar { ...; } }
is a perfectly valid and common use of closures, I would not want:
sub foo { state $state_var; ...; } sub bar { state $state_var; ...; }
to auto-magically assume both (or all at "same" level) declarations of $state_var to be the same variable.
I am pretty sure that state was not designed as a replacement for "traditional" closure constructs, rather just as a short cut for a specific use case.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^7: Experimental features: autoderef vs postfix deref
by BrowserUk (Patriarch) on Jul 13, 2015 at 20:05 UTC | |
by RonW (Parson) on Jul 13, 2015 at 20:34 UTC | |
by golux (Chaplain) on Jul 14, 2015 at 18:01 UTC |