[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: modules, require, magic
- From: Roberto Ierusalimschy <roberto@...>
- Date: Sun, 16 Oct 2011 21:43:16 -0200
> By the way, how hard it would be implement something like the "module"
> in the top chunk above in Lua 5.2? What are the difficulties? Would it
> need to call the debug library? Would it need to do something that can
> only be done from C? This is a honest, though maybe a dumb, question...
It is quite easy to write a 'module' function in 5.2, using the debug
library. (But it will not allow multiple modules in a single file,
which is a kind of hack anyway ;)