lua-users home
lua-l archive

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


It was thus said that the Great Roberto Ierusalimschy once stated:
> >   I'm surprised that Lua doesn't look for just 
> > 
> > 		luaopen()
> > 
> > as part of the search mechanism.  It's a dynamic library---there is no
> > problem what-so-ever in loading multiple shared libs with functions of the
> > same name [5] so as a fall-back, just calling luaopen() would seem to be
> > obvious [6].  I'm just curious as to why that wasn't done.  If it had, then
> > it would be easy to move, say, "org.conman.env" [7] to another location.
> 
> Modules are not always linked dynamically (see, for instance, the
> standard Lua libraries). With a single name, one would not be able to
> statically link a set of modules to a program.

  I'm sorry if I didn't make myself clearer, but the intent was to look for,
say, "luaopen_foo" and if that wasn't found, try just "luaopen".  

> (Moreover, I am not sure your experience number [5] is portable. IIRC,
> we had problems in the past with some systems that signalled name
> conflicts even with dynamic libraries.)

  Hmm ... now that I think about it, that program was only ever used on
Linux (it was written in the late 90s by the way).  So, you got conflicts
with dlopen()?  (I can see conflicts if you are trying to link multiple
shared objects with the same name with the linker, but not with dlopen()).
Sadly, while surprising, it doesn't really surprise me all that much (if
that makes sense).

  -spc