Functions which operate on namespaces.
Creates and pushes a new namespace object whose parent namespace will be set to the current function's environment (or the global namespace if there is no current function).
This is the same behavior as namespace name {}
in Croc (though it doesn't actually declare the namespace; you'll have to store it somewhere, like in a global).
- Parameters
-
name | is the name that the namespace will be given. |
- Returns
- the stack index of the pushed value.
Creates and pushes a new namespace object whose parent is in slot parent
.
- Parameters
-
parent | should be either a namespace or null, in which case the new namespace will have no parent. |
name | is the name that the namespace will be given. |
- Returns
- the stack index of the pushed value.
Creates and pushes a new namespace object without a parent.
- Parameters
-
name | is the name that the namespace will be given. |
- Returns
- the stack index of the pushed value.
Removes all key-value pairs from the namespace in slot ns
.
Pushes the "full name" of the namespace in slot ns
, which is the name of the namespace and all its parents, separated by dots.
- Returns
- the stack index of the pushed value.