lua-users home
lua-l archive

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


Thatcher Ulrich wrote:
> I don't think Lua really should aspire to be a Perl replacement
> though.  In the spirit of keeping things small and simple (which is
> not the Perl spirit), I think if we can bless one of the loadlib's as
> the preferred one, and establish some baseline conventions for making
> packages get along with each other, and start producing our add-ons
> within those conventions, then we don't need all the bells and
> whistles right away.  We'll have taken a huge and welcome step
> forward.

I agree with you that establishing some conventions for making modules would
be a great step forward ;-)

The problem of loadlib is that even if it works on multiple platforms the
behaviour on them is different. Since lua has adopted the 'requiere' term to
load requiered lua files once, probably inspired by perl's 'require'. We
could adopt the 'use' term to load requiered libraries. The difference,
however, is that perl loads modules statically and lua does it dynamically.

What I'm not really sure is, if there should be a mechanism to explicitely
unload modules. Libraries should be kept in a table to avoid double loading
them, so closing the lua state would remove the libraries and with tag
methods you can prevent leaks, so that's not a problem. I just want to know
if it's necessary or if it's a good idea to unload a module, and remove the
functions it has exported.



Ignacio Castaño
castano@asidesoft.com



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com