lua-users home
lua-l archive

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





Looks pretty thorough, good job!  The only thing I saw that might be
worth mentioning is some modules monkey-patch globals, and should only
be run once -- but they export/expose nothing so they return boolean
'true'.  You can return anything in a module of course -- the value
becomes referenced from package.loaded.module_name = <return value>.
If a module returns false or nil, I believe it will be loaded from the
file on every require().


I didn't think that was worth mentioning explicitly. "Monkey-patch modules" are (or should be) infrequent - I suppose I could add them as an example in rule #6.

That said, why should I mention that "they should be run once"? When I require a module twice, the second require will not "run" it again, afaik.

Regards,

Enrique ( kikito / @otikik )