lua-users home
lua-l archive

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




On 12/02/16 04:30 PM, Phil Leblanc wrote:
We usually put some information strings into our modules, e.g.
[ ..._COPYRIGHT, _DESCRIPTION, _VERSION ...]
How do other module-writer handle such?
I wonder how other module-*users* handle such.

_VERSION may be useful to make choices according to the version of the
API or of the implementation.

But is the copyright or description (or author or ...) string useful
for the program using the module?

I think that the right place for all these metadata is in source code
comments, LICENSE files, documentation, rocks and such.

Regarding the leading underscore, I am not a big fan either. Do we
really spell _VERSION instead of VERSION because we also have a
different 'VERSION' constant in our own module?  :-)    but at least
it is consistent with the Lua global _VERSION constant.

A standardized mod.docs[mod.func] -> "func(a: integer, b: number, c: string): string -> Does something" would be useful. You wouldn't have to look at stuff to see it, you'd be able to see it from the REPL. Kinda like Python.

--
Disclaimer: these emails may be made public at any given time, with or without reason. If you don't agree with this, DO NOT REPLY.