lua-users home
lua-l archive

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


On Tue, Apr 16, 2013 at 1:22 PM, steve donovan <steve.j.donovan@gmail.com> wrote:

It's 'import pairs, ipairs from _G' in Moonscript (which sometimes seems like a catalog of would-be features discussed on lua-l) 

OK, not difficult to write a macro to do this, but that feels over-the-top.  Otherwise it really does need to be a core change because it generates local slots which can only be assigned at compile-time.


How about if the following were allowed:

Local, followed by one or more variable names, separated by a comma and not followed by an equal sign, is to be read as the equivalent of assigning a global variable of the same name to the local scope. Such that:

local print, table, math, coroutine.create

is equivalent to:

local print, table, math, create = print, table, math, coroutine.create



I like that because I'm lazy.


-Andrew