Provides the data structures for LISP, like cells.
More...
|
void | unsafe_cell_remove (cell *c) |
|
cell_block * | cell_block_create (size_t s) |
|
void | cell_block_free (cell_block *cb) |
|
void | init_memory () |
|
void | free_memory () |
|
cell_space * | cell_space_create () |
|
cell * | cell_space_get_cell (cell_space *cs) |
|
cell * | cell_space_is_symbol_allocated (cell_space *cs, char *symbol) |
|
void | cell_space_init (cell_space *cs) |
|
void | cell_space_grow (cell_space *cs) |
|
void | cell_space_double_capacity_if_full (cell_space *cs) |
|
void | cell_space_mark_cell_as_free (cell_space *cs, cell *c) |
|
void | cell_space_free (cell_space *cs) |
|
bool | cell_space_is_full (cell_space *cs) |
|
cell * | get_cell () |
|
cell * | mk_num (int n) |
|
cell * | mk_str (char *s) |
|
cell * | mk_cons (cell *car, cell *cdr) |
|
cell * | mk_sym (char *symbol) |
|
cell * | mk_builtin_lambda (char *symbol, cell *(*function)(cell *), void(*builtin_stack)(size_t, unsigned char)) |
|
cell * | mk_builtin_macro (char *symbol, cell *(*function)(cell *, cell *)) |
|
cell * | copy_cell (cell *c) |
|
void | free_cell_pointed_memory (cell *c) |
|
bool | is_num (cell *c) |
|
bool | is_str (cell *c) |
|
bool | is_cons (cell *c) |
|
bool | is_sym (cell *c) |
|
bool | is_keyword (cell *c) |
|
bool | is_builtin (cell *c) |
|
bool | is_builtin_lambda (cell *c) |
|
bool | is_builtin_macro (cell *c) |
|
cell * | is_symbol_builtin_lambda (char *symbol) |
|
cell * | is_symbol_builtin_macro (char *symbol) |
|
bool | cell_is_in_global_env (cell *global_env, cell *c) |
|
void | cell_push (cell *val) |
|
void | cell_remove (cell *val) |
|
void | cell_push_recursive (cell *c) |
|
void | cell_remove_recursive (cell *c) |
|
void | cell_remove_args (cell *args) |
|
void | cell_remove_pairlis (cell *new_env, cell *old_env) |
|
void | cell_remove_cars (cell *list) |
|
void | cell_remove_pairlis_deep (cell *new_env, cell *old_env) |
|
void | collect_garbage (cell_space *cs) |
|
void | deep_collect_garbage (cell_space *cs) |
|
void | mark_memory (cell_space *cs) |
|
void | mark (cell *root) |
|
void | sweep (cell_space *cs) |
|
void | deep_sweep (cell_space *cs) |
|
Provides the data structures for LISP, like cells.
Basic Lisp entity.
Every cell has a type identifier (referred to the type enum). It identifies the type of the cell. marked
and marks
are fields used to collect garbage.
Identifies the type of a cell.
Enumerator |
---|
TYPE_CONS |
|
TYPE_SYM |
|
TYPE_NUM |
|
TYPE_STR |
|
TYPE_FREE |
|
TYPE_BUILTINLAMBDA |
|
TYPE_BUILTINMACRO |
represents a builtin lisp function (e.g. car, cdr...)
|
TYPE_KEYWORD |
represents a builtin lisp macro (e.g. dotimes, defun...)
|
bool cell_is_in_global_env |
( |
cell * |
global_env, |
|
|
cell * |
c |
|
) |
| |
void cell_push |
( |
cell * |
val | ) |
|
void cell_push_recursive |
( |
cell * |
c | ) |
|
void cell_remove |
( |
cell * |
val | ) |
|
void cell_remove_args |
( |
cell * |
args | ) |
|
void cell_remove_cars |
( |
cell * |
list | ) |
|
void cell_remove_pairlis |
( |
cell * |
new_env, |
|
|
cell * |
old_env |
|
) |
| |
void cell_remove_pairlis_deep |
( |
cell * |
new_env, |
|
|
cell * |
old_env |
|
) |
| |
void cell_remove_recursive |
( |
cell * |
c | ) |
|
void cell_space_double_capacity_if_full |
( |
cell_space * |
cs | ) |
|
cell* cell_space_is_symbol_allocated |
( |
cell_space * |
cs, |
|
|
char * |
symbol |
|
) |
| |
void free_cell_pointed_memory |
( |
cell * |
c | ) |
|
bool is_builtin |
( |
cell * |
c | ) |
|
bool is_builtin_lambda |
( |
cell * |
c | ) |
|
bool is_builtin_macro |
( |
cell * |
c | ) |
|
bool is_keyword |
( |
cell * |
c | ) |
|
cell* is_symbol_builtin_lambda |
( |
char * |
symbol | ) |
|
cell* is_symbol_builtin_macro |
( |
char * |
symbol | ) |
|
cell* mk_builtin_lambda |
( |
char * |
symbol, |
|
|
cell *(*)(cell *) |
function, |
|
|
void(*)(size_t, unsigned char) |
builtin_stack |
|
) |
| |
cell* mk_sym |
( |
char * |
symbol | ) |
|
void unsafe_cell_remove |
( |
cell * |
c | ) |
|