getroottable
Global, available without an import
getroottable(): table
Returns the root table.
Return value
The root table itself, the same object that is available using :: operator. ::foo is equivalent to getroottable()["foo"].
Example
::GLOBAL_VAR <- 1
getroottable().GLOBAL_VAR = 2
println("::GLOBAL_VAR =", ::GLOBAL_VAR) // a write through getroottable() reaches the real global
getroottable().NEW_ONE <- 3
println("::NEW_ONE =", ::NEW_ONE) // new slots too
println("getroottable() == getroottable() =", getroottable() == getroottable()) // the same table every callOutput:
::GLOBAL_VAR = 2
::NEW_ONE = 3
getroottable() == getroottable() = trueSee also
getconsttable | Returns the const table. |
compilestring | Compiles source into a callable closure, without running it. |
| globals | module index |