lua-users home
lua-l archive

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


> I'm trying to find a way to allow Lua to load different versions of a library but only one per process. [...] I'm probably going to rewrite the require function to enable this requirement.

require already does support versions albeit in an awkward way:

  "Moreover, if the module name has a hyphen, its prefix up to (and
  including) the first hyphen is removed. For instance, if the module name
  is a.v1-b.c, the function name will be luaopen_b_c."

  http://www.lua.org/manual/5.1/manual.html#pdf-package.loaders