[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Global access control
- From: David Jeske <jeske@...>
- Date: Sun, 28 Dec 1997 11:19:19 -0800
I like solution, and it's my opinion that it would be a worthwhile
addition to standard Lua.
On Sun, Dec 28, 1997 at 04:06:56PM -0200, rw20@cornell.edu wrote:
> Is there any news as to what (if any) strategy might be adopted
> officailly by Lua to control access to globals? Having the option of
> requiring global access declarations would make Lua much more robust.
>
> I've already written something like
>
> $noglobals
> z=10
> q=45
> g=54
>
> function example(x)
> local w,y
> global z,q
> w=x*x
> print(w+x+q)
> print(g) -- error
> end
>
> In standard mode lua just ignores the global list, so this code works in
> either mode ($globals or $noglobals).
>
> Russ
>
--
David Jeske (N9LCA) + http://www.chat.net/~jeske/ + jeske@chat.net