Re: State variables

On Thu, 2006-05-04 at 19:27 +0200, A. Pagaltzis wrote:
* Torsten Schoenfeld <kaffeetisch gmx de> [2006-05-04 19:05]:
If you put a block around a sub, you can declare a lexical
variable in that scope but outside the sub.  It will then
behave like a state variable:

Is that really exactly what state variables do? So far, all
explanations about what state variables in Perl 6 are for have
left me confused. I assumed they work the way you outlined, but
all descriptions I’ve seen make them sound much more subtle and
hard to grasp.

All I can find about C<state> variables in Perl 6 seems to suggest that,
yes, that's really all they do.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]