lua-users home
lua-l archive

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


<...>
> Alternative solution:
> I understand that you want the module-loading function to be called
> "module", while limiting backward compatibility issues. What if you call the
> old module function, say, legacy_module(), and add in base lib the
> equivalent of:

>     function package.preload.module51() module=legacy_module end

> This way, adding a single 'require "module51"' at the beginning of an
> application makes all indirectly required modules lua 51 compatible. You can
> even do it from the command line with "lua -lmodule51 ...".

I like this. This actually looks like a good idiom for providing
backwards compatibility options without forcing user to recompile the
interpreter.

Alexander.