Go to the source code of this file.
|
int | lbm_init_env (void) |
|
lbm_value * | lbm_get_env_ptr (void) |
|
lbm_value | lbm_get_env (void) |
|
lbm_value | lbm_env_copy_spine (lbm_value env) |
|
bool | lbm_env_lookup_b (lbm_value *res, lbm_value sym, lbm_value env) |
|
lbm_value | lbm_env_lookup (lbm_value sym, lbm_value env) |
|
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) |
|
lbm_value | lbm_env_build_params_args (lbm_value params, lbm_value args, lbm_value env0) |
|
◆ lbm_env_build_params_args()
Extend an environment given a list of keys and a list of values.
- Parameters
-
params | The list of keys. |
args | The list of values. |
env0 | An initial environment to extend |
- Returns
- The extended environment on success and lbm_enc_sym(SYM_MERROR) if GC needs to be run.
◆ 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()
Lookup a value in from the global environment.
- Parameters
-
sym | The key to look for in the environment |
env | The environment to search for the key. |
- Returns
- The value bound to key or lbm_enc_sym(SYM_NOT_FOUND).
◆ lbm_env_lookup_b()
Lookup a value in from the global environment.
- Parameters
-
sym | The key to look for in the environment |
env | The environment to search for the key. |
- Returns
- The value bound to key or lbm_enc_sym(SYM_NOT_FOUND).
◆ 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_env()
- Returns
- the global environment
◆ lbm_get_env_ptr()
Get a pointer to the global environment.
- Returns
- A pointer to the global environment variable.
◆ lbm_init_env()
int lbm_init_env |
( |
void |
| ) |
|
Initialize the global environment. This sets the global environment to NIL
- Returns
- 1