lval.h file
Contents
- Reference
Functions
- auto lval_num(long num) -> lval*
- Creates an lval of type LVAL_NUM.
- auto lval_err(const char* fmt, ...) -> lval*
- Creates an lval of type LVAL_ERR.
- auto lval_sym(const char* sym) -> lval*
- Creates an lval of type LVAL_SYM.
- auto lval_str(const char* str) -> lval*
- TODO.
- auto lval_sexpr(void) -> lval*
- Creates an lval of type LVAL_SEXPR.
- auto lval_qexpr(void) -> lval*
- Creates an lval of type LVAL_QEXPR.
- auto lval_fun(lbuiltin func) -> lval*
- Constructs an lval of type LVAL_FUN.
- auto lval_lambda(lval* formals, lval* body) -> lval*
- Constructs a lambda lval.
- void lval_del(lval* obj)
- Frees an lval.
- auto lval_add(lval* parent, lval* child) -> lval*
- Adds the child l_arg to the parent
obj
. - auto lval_copy(const lval* obj) -> lval*
- Copies an lval.
- auto lval_pop(lval* obj, unsigned ith) -> lval*
- Pops the ith element off of the lval
obj
. - auto lval_take(lval* obj, unsigned ith) -> lval*
- Takes the ith element off of the lval
obj
. - auto lval_eval(lenv* env, lval* obj) -> lval*
- Evaluates the lval
obj
. - auto lval_call(lenv* env, lval* func, lval* arg) -> lval*
- TODO.
- auto lval_eval_sexpr(lenv* env, lval* sexpr) -> lval*
- Evaluates the lval
obj
as an S-Expression. - auto lval_join(lval* l_arg, lval* r_arg) -> lval*
- Joins the Q-Expression r_arg to l_arg.
- auto lval_eq(lval* l_arg, lval* r_arg) -> int
- TODO.
- auto load_prelude(lenv* env) -> lval*
- TODO.
Function documentation
lval* lval_sexpr(void)
Creates an lval of type LVAL_SEXPR.
Returns | lval* |
---|
Creates an lval of type LVAL_SEXPR which is an empty S-Expression.
lval* lval_qexpr(void)
Creates an lval of type LVAL_QEXPR.
Returns | lval* |
---|
Creates an lval of type LVAL_QEXPR which is an empty Q-Expression.
lval* lval_lambda(lval* formals, lval* body)
Constructs a lambda lval.
Parameters | |
---|---|
formals | - type: lval* |
body | - type: lval* |
Returns | lval* |
Constructs a lambda lval.
lval* lval_eval_sexpr(lenv* env, lval* sexpr)
Evaluates the lval obj
as an S-Expression.
Parameters | |
---|---|
env | - type: lenv* |
sexpr | - type: lval* |
Returns | lval* |
Evaluates the lval obj
as an S-Expression. Returns obj
as-is if it has no children or returns the child if it only has one child. Returns an error if the child does not start with a symbol.