Utils.Globals module

Additional lua globals

Functions

STDLIB.create_stdlib_globals([files]) load the stdlib into globals, by default it loads everything into an ALLCAPS name.
STDLIB.install_all_utils() Install Math, String, Table into their global counterparts.
STDLIB.install_math() Install the Math library into global math
STDLIB.install_string() Install the string library into global string
STDLIB.install_table() install the Table library into global table
STDLIB.reload_class() Reload a required file, NOT IMPLEMENTED
inline_if(exp, t, f) Returns t if the expression is true.
prequire(module, suppress_all) Require a file that may not exist
rawtostring(t) Temporarily removes __tostring handlers and calls tostring

Functions

# STDLIB.create_stdlib_globals([files])

load the stdlib into globals, by default it loads everything into an ALLCAPS name.

Alternatively you can pass a dictionary of [global names] -> [require path].

Parameters:
  • files : (table) (optional)
Usage:
STDLIB.create_stdlib_globals()
# STDLIB.install_all_utils()

Install Math, String, Table into their global counterparts.

# STDLIB.install_math()

Install the Math library into global math

# STDLIB.install_string()

Install the string library into global string

# STDLIB.install_table()

install the Table library into global table

# STDLIB.reload_class()

Reload a required file, NOT IMPLEMENTED

# inline_if(exp, t, f)

Returns t if the expression is true.

f if false

Parameters:
  • exp : (mixed) The expression to evaluate
  • t : (mixed) the true return
  • f : (mixed) the false return
Returns:
# prequire(module, suppress_all)

Require a file that may not exist

Parameters:
  • module : (string) path to the module
  • suppress_all : (boolean) suppress all errors, not just file_not_found
Returns:
  • (mixed)
# rawtostring(t)

Temporarily removes __tostring handlers and calls tostring

Parameters:
  • t : (mixed) object to call rawtostring on
Returns: