[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: modules, require, magic
- From: Tony Finch <dot@...>
- Date: Wed, 19 Oct 2011 09:28:55 +0100
Hisham <hisham.hm@gmail.com> wrote:
>
> For that reason, I think #5 produces the clearest programming idiom.
> Distinguishing private and public functions with "local function" and
> "function" is very logical, if you think of "module" abstractly, as a
> language feature.
One of the key goals of 5.2 is to put Lua's scoping on a more solid
conceptual foundation. Getting rid of setfenv except as a dirty debugging
feature is a key part of that.
Luiz's module pattern gives you 'local function foo" for private functions
and "function module.bar" for exported ones.
Tony.
--
f.anthony.n.finch <dot@dotat.at> http://dotat.at/
East Sole: Northerly or northwesterly 4 or 5, occasionally 6 at first. Rough
or very rough. Showers then fair. Good.
- References:
- modules, require, magic, Eduardo Ochs
- Re: modules, require, magic, Javier Guerra Giraldez
- Re: modules, require, magic, Petite Abeille
- Re: modules, require, magic, Sam Roberts
- Re: modules, require, magic, David Manura
- Re: modules, require, magic, Hisham