Menu

DevDocs_LuaLib_NameSpaces Log in to Edit

Kevin Cox

Developer Documentation - Lua Namespaces

C

The Core namespace. this houses the most basic functions. The idea is for this to be used primarially by the lua libraries and for the average user to never need. This should only be used for the odd-ball case where the user needs to do something very special.

D

The Definitions namespace. This is where the command line arguments are loaded into.

Examples of how the arguments are loaded.

gen -Dkey        .. # D.key == true
gen -Dkey=       .. # D.key == ""
gen -Dkey=value  .. # D.key == "value"
gen -D key=value .. # D.key == "value"

Please note the difference between a flag (a key with no value) and a key with an empty value.

S

The Standard library namespace. This namespace is home to all of the standard libraries.

P

The Persistant namespace. This namespace is used to store data between runs of the standard libraries. The S namespace (as well as L) is wiped before running each file. So if you do some expensive operation that doesn't need to be done twice (52) times. You can save your results here. Please save your results under the path you have under _G (the global object). For example, S.c would save under P.S.c and L.myLib would save under P.L.myLib. This is NOT intended to be used by user code.


Discussion

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.