[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Lua 5.2.0 (work4) now available
- From: Roberto Ierusalimschy <roberto@...>
- Date: Sun, 8 Aug 2010 19:34:15 -0300
> On Sat, Aug 7, 2010 at 9:50 AM, Petri Häkkinen <petrih3@gmail.com> wrote:
> > On 7.8.2010, at 6.10, Mark Hamburg <mark@grubmah.com> wrote:
> >> This hardly seems particularly bizarre and it doesn't rely on tricks with
> >> environment to change global assignments into exported values.
> >>
> > Indeed. Honestly this should become the recommended practice or the new
> > 'policy', if you will. It's as explicit and simple as it gets.
>
> Yes, much easier to explain to a newcomer. _We_ may get module() but
> it's a subtle sideways beast, with pitfalls as pointed out by David M.
> (We also tend to forget our initial puzzlement with module())
>
> Also, it is invariant with respect to the 5.1 -> 5.2 transformation ;)
Just recently I rewrote the 're' module in LPEG to be invariant with
respect to the 5.1->5.2 transformation. I used a slightly different
technique. I declared everything local and only in the end I exported
what I wanted:
local function foo1 ...
local function foo2 ...
local function foo3 ...
...
return {
foo1 = foo1,
foo3 = foo3,
}
-- Roberto