[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lexical environments
- From: steve donovan <steve.j.donovan@...>
- Date: Wed, 3 Feb 2010 08:19:47 +0200
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.