lua-users home
lua-l archive

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


On Tue, Aug 10, 2010 at 1:42 PM, Shawn Fox <shawnkfox@gmail.com> wrote:
> So based on this I think what I'm really asking for is that something like:
>
> foo = namespace
>     local x = 99
>    function bar(y) print(x+y) end
> end

which isn't too different from what I would recommend below, where f
could be various functions including `namespace` and `class` suitably
defined:

  foo = f(function(M)
    local x = 99
    function M.bar(y) print(x+y) end
  end)