[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: require vs dofile and how to organise many functions
- From: Petite Abeille <petite_abeille@...>
- Date: Tue, 21 Jul 2009 18:38:53 +0200
On Jul 21, 2009, at 10:05 AM, startx wrote:
i know that require has the advantage to load both pure lua and C
extentions, but is there any other technical difference i am not aware
of? (memory management etc)
As mentioned by Steve, require will keep track of what has already
Take a look at Kepler's 'compat' to get a sense on how to simulate it:
or is this just a decision of coding style?
Style and pragmatism. After all, Lua doesn't include many batteries.
Doesn't hurt to use the few which are provided.
For a contrarian view on module, check David Manura rant:
I, for one, welcome our module overlord :)
would this be considered an inappropriate coding style?
Yes, quite bad taste indeed :P
On the other hand, "des goûts et des couleurs on ne discute pas"...
i haven't seen this in other projects so far ....
LuaSocket uses such constructs. Always found that sort of packaging
very cumbersome. Of course, YMMV.