lua-users home
lua-l archive

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


John Belmonte wrote:
> By the way, I can imagine adding some syntatic sugar for a namespace
> support which handles the common case used below.  Synopsis:
> 
>      mymod = namespace
>        local val
>        function foo() ... end
>          .
>          .
>          .
>      end
> 

I guess if you're willing to change your syntax a little, it'll
even be possible to do this all in lua itself yet again.
Something like:

namespace mynamespace

function foo() ... end

endnamespace

Where "namespace" and "endnamespace" are functions that 
perform the swapping and storing of the functions 
and the global environment... I'll look into
this next week at my work if I have the time.


-- 
"No one knows true heroes, for they speak not of their greatness." -- 
Daniel Remar.
Björn De Meyer 
bjorn.demeyer@pandora.be