[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua modules, explained simply
- From: Lorenzo Donati <lorenzodonatibz@...>
- Date: Sat, 16 Jul 2011 08:54:06 +0200
On 16/07/2011 7.01, Ross Andrews wrote:
Yeah, I'm going to need to make another post about modules in 5.2 when
it's fully released.
Please, remember not to top-post. See below for the reply to your message.
On Fri, Jul 15, 2011 at 11:38 PM, Josh Simmons <firstname.lastname@example.org
On Sat, Jul 16, 2011 at 4:55 AM, Ross Andrews
<email@example.com <mailto:firstname.lastname@example.org>> wrote:
> Because it confused me, I thought some people on here might be
> just made a blog post explaining why and how to use modules, and
> I'd love any feedback you all may have!
> --Ross Andrews
You might want to note that module is deprecated in 5.2 and not really
needed in 5.1 anyway, avoiding all the environment tomfoolery.
Please note: it is not a new 5.2 approach. 5.2 simply officially
deprecated a practice that was already considered somewhat harmful. The
5.1 module function has been considered "out of fashion" for rather a
long time even in 5.1.
Lua 5.1 will be current yet for some time (BTW LuaJIT is 5.1 compatible
and according to Mike Pall the switch to 5.2 won't happen in the near
future). So the way you explain modules could lead a novice user to
learn quite an old way of defining them (which involves subtle side
So adding a disclaimer or pointers to more current way of defining
modules may be appropriate.
You might be interested in the following:
(There are other threads in the list about "module" function, that was
the one I remembered better because I started it when I was a Lua newby
and It contains various "wisdom gems" by other people, especially
Roberto from Lua Team)