lua-users home
lua-l archive

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


I guess every Lua programmer has a plethora additional utilities for, say, strings or tables, that complement the standard libraries for these types. Obviously, I have two basic possibilities to make these additional utilities available, either adding directly to the global '_G.string' or '_G.table' tables, or to create my own namespaces, such as 'string2' or 'table2'.

As long as I do my own, private thing, it does not really matter, and I might be tempted to add to the existing global namespaces, so that _all_ table-utilities are uniformly accessible via 'table.some_util ()' and so on. However, based on my background, I'd rather use separate namespaces for additional libs, just to avoid possible conflicts.

I was wondering how you experts are handling this. Note that I am not asking for anything normative, as I don't expect something of this sort to exist in the liberal Lua world. :-) I kindly ask for personal prefs and habits, or possibly company-local guidelines.

Thanks and regards
- Stefan