lua-users home
lua-l archive

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


> > Say there were a new statement of the form:
> >         global var1, var2, var3
> 
> The above proposal and the previous proposal for
> 
>    import var1, var2, var3 from foo
>    --> local var1, var2, var3 = foo.var1, foo.var2, foo.var3
> 
> I would suggest be unified as such:
> 
>   global var1, var2, var3 in foo
>   local var1, var2, var3 in foo

The first form ("global in") was proposed in 2002 [1], with an extra
form "global in T" (without names) which would access all undeclared
variables in 'T'. It would be part of 5.0. In the end, we opted for
setfenv.

[1] http://lua-users.org/lists/lua-l/2002-04/msg00098.html

-- Roberto