lua-users home
lua-l archive

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

On Thu, Feb 11, 2016 at 5:08 AM, Marc Balmer <> wrote:
> We usually put some information strings into our modules, e.g.
>         lua_pushliteral(L, "_COPYRIGHT");
>         lua_pushliteral(L, "Copyright (C) 2014 micro systems marc balmer");
>         lua_settable(L, -3);
>         lua_pushliteral(L, "_DESCRIPTION");
>         lua_pushliteral(L, "EAN support functions");
>         lua_settable(L, -3);
>         lua_pushliteral(L, "_VERSION");
>         lua_pushliteral(L, "ean 1.0.1");
>         lua_settable(L, -3);
> How do other module-writer handle such?  Do you put such information into modules?  Do you think it makes sense?  Is it of any use at all?  Is it common practice? (yes, I am considering removing it...)

I had never thought about this, but it does makes sense. Especially
the _VERSION field, as then another module depending on it could
programmatically check the version number and alter its behavior
accordingly, which would be useful in the case where the dependency
has made backward-incompatible changes and the author of the depending
modules doesn't know which version the end user will have installed.

On Thu, Feb 11, 2016 at 5:13 AM, Daniel Silverstone
<> wrote:
> I think it's sensible to include that kind of data but I'd love for
> there to be an LEP toward standardising it.  Then we might see an extension to
> require() to support minimum version checking or similar, which would be
> lovely.

Standardization would be wonderful.