lua-users home
lua-l archive

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


On Wed, Feb 3, 2010 at 7:39 AM, Mark Hamburg <mark@grubmah.com> wrote:
> I'm imagining it becoming much more common to write things like:
>
>        local math, string from _G


Very common pattern when writing modules that don't leak!

Adding a new keyword once in a blue moon is not a great disaster, if
it gives us such excellent convenience.[1]

Of course, such things can be done with macros e.g. 'import(math
string,_G)' or even 'import math,string from _G'. The token filter
patch is relatively stable and straightforward (although I suspect it
breaks things like \xFF in lua 5.2) so macros are actually more
portable than deep parse hacks.

steve d.

[1] But that naturally applies to many little syntax tweaks. Many
prefer Lua to be as sugar-free as possible.