Go to the source code of this file.
|
int | lbm_init_env (void) |
|
lbm_value * | lbm_get_global_env (void) |
|
lbm_uint | lbm_get_global_env_size (void) |
|
lbm_value | lbm_env_copy_spine (lbm_value env) |
|
bool | lbm_env_lookup_b (lbm_value *res, lbm_value sym, lbm_value env) |
|
bool | lbm_global_env_lookup (lbm_value *res, lbm_value sym) |
|
lbm_value | lbm_env_set (lbm_value env, lbm_value key, lbm_value val) |
|
lbm_value | lbm_env_set_functional (lbm_value env, lbm_value key, lbm_value val) |
|
lbm_value | lbm_env_modify_binding (lbm_value env, lbm_value key, lbm_value val) |
|
lbm_value | lbm_env_drop_binding (lbm_value env, lbm_value key) |
|
◆ GLOBAL_ENV_MASK
#define GLOBAL_ENV_MASK 0x1F |
◆ GLOBAL_ENV_ROOTS
#define GLOBAL_ENV_ROOTS 32 |
◆ lbm_env_copy_spine()
Copy the spine of an environment. The list structure is recreated but the values themselves are not copied but rather just referenced.
- Parameters
-
- Returns
- Copy of environment.
◆ lbm_env_drop_binding()
Removes a binding (destructively) from the input environment.
- Parameters
-
env | Environment to modify. |
key | Key to remove from environment. |
- Returns
- Updated environment or not_found symbol.
◆ lbm_env_lookup_b()
Lookup a value in an environment.
- Parameters
-
res | Result stored here |
sym | The key to look for in the environment |
env | The environment to search for the key. |
- Returns
- True on success or false otherwise.
◆ lbm_env_modify_binding()
Modifies an existing binding on the environment.
- Parameters
-
env | The environment to modify. |
key | The key. |
val | The new value to associate with the key. |
- Returns
- The modified environment of Success and lbm_enc_sym(SYM_NOT_FOUND) if the key does not exist.
◆ lbm_env_set()
Create a new binding on the environment or replace an old binding.
- Parameters
-
env | Environment to modify. |
key | A symbol to associate with a value. |
val | The value. |
- Returns
- The modified environment or lbm_enc_sym(SYM_MERROR) if GC needs to be run.
◆ lbm_env_set_functional()
Create a new binding on the environment without destroying the old value. If the old value is unused (the key-value pair) it will be freed by GC at next convenience.
- Parameters
-
env | Environment to modify. |
key | A symbol to associate with a value. |
val | The value. |
- Returns
- The modified environment or lbm_enc_sym(SYM_MERROR) if GC needs to be run.
◆ lbm_get_global_env()
- Returns
- the global environment
◆ lbm_get_global_env_size()
lbm_uint lbm_get_global_env_size |
( |
void |
| ) |
|
- Returns
- the size of the global env in number of heap cells.
◆ lbm_global_env_lookup()
Lookup a value in the global environment.
- Parameters
-
res | Result stored here |
sym | The key to look for in the environment |
env | The environment to search for the key. |
- Returns
- True on success or false otherwise.
◆ lbm_init_env()
int lbm_init_env |
( |
void |
| ) |
|
Initialize the global environment. This sets the global environment to NIL
- Returns
- 1