lua-users home
lua-l archive

Re: Upvalue question

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


> The 3 lines of code were supposed to be run in a file, not interactively.
> When you run interactively, each line is a separate chunk and so 's' is
> local in the first one, but global in the second one, hence the error.
Oops. That's clearly what I've been doing wrong earlier as well :)
(I guess I'm used to the behaviour of the Python interpreter here,
as in many other cases ;)
Thanks for your help.
> --lhf
--
 Magnus Lie Hetland (magnus at hetland dot org)
 "Reality is what refuses to disappear when you stop
 believing in it" -- Philip K. Dick

AltStyle によって変換されたページ (->オリジナル) /