Go to the source code of this file.
◆ GLOBAL_ENV_MASK
| #define GLOBAL_ENV_MASK 0x1F |
Symbol to hashtable entry hashfunction
◆ GLOBAL_ENV_ROOTS
| #define GLOBAL_ENV_ROOTS 32 |
Global environment hashtable size
◆ 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.
- Warning
- Internal: For internal use only.
- Parameters
-
- Returns
- Copy of environment.
◆ lbm_env_drop_binding()
Removes a binding (destructively) from the input environment.
- Warning
- Thread Requirement: This function MUST be called in the same thread as the evaluator OR the evaluator must be paused.
- 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.
- Note
- Recommendation: If called from an external thread, pausing the evaluator is recommended.
- 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.
- Warning
- Thread Requirement: This function MUST be called in the same thread as the evaluator OR the evaluator must be paused.
- 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
- Pointer to 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.
- Note
- Recommendation: If called from an external thread, pausing the evaluator is recommended.
- 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()
| bool lbm_init_env |
( |
void |
| ) |
|
Initialize the global environment. This sets the global environment to NIL
- Returns
- true on success and false on failure.