lua-users home
lua-l archive

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


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.