diff options
| author | Keith Packard <keithp@keithp.com> | 2016-11-10 11:30:55 -0800 | 
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2017-02-20 11:16:50 -0800 | 
| commit | c7d7cdc2318a97534c4c1f9c6fd2b51644be729d (patch) | |
| tree | 6db3879511a9ab393d5835eb9b81ef2eaedad9c9 /src/lisp/ao_lisp.h | |
| parent | 417161dbb36323b5a6572859dedad02ca92fc65c (diff) | |
altos/lisp: add progn, while, read and eval
Progn as a builtin will help with tail-recursion.
while provides for loops until tail-recursion works :-)
read and eval are kinda useful.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/lisp/ao_lisp.h')
| -rw-r--r-- | src/lisp/ao_lisp.h | 11 | 
1 files changed, 10 insertions, 1 deletions
| diff --git a/src/lisp/ao_lisp.h b/src/lisp/ao_lisp.h index de55b307..d265ea7b 100644 --- a/src/lisp/ao_lisp.h +++ b/src/lisp/ao_lisp.h @@ -40,6 +40,8 @@ extern uint8_t ao_lisp_const[AO_LISP_POOL_CONST];  #define _ao_lisp_atom_lambda	_atom("lambda")  #define _ao_lisp_atom_led	_atom("led")  #define _ao_lisp_atom_delay	_atom("delay") +#define _ao_lisp_atom_eval	_atom("eval") +#define _ao_lisp_atom_read	_atom("read")  #else  #include "ao_lisp_const.h"  #ifndef AO_LISP_POOL @@ -158,7 +160,10 @@ enum eval_state {  	eval_formal,  	eval_exec,  	eval_cond, -	eval_cond_test +	eval_cond_test, +	eval_progn, +	eval_while, +	eval_while_test,  };  struct ao_lisp_stack { @@ -198,6 +203,8 @@ struct ao_lisp_builtin {  };  enum ao_lisp_builtin_id { +	builtin_eval, +	builtin_read,  	builtin_lambda,  	builtin_lexpr,  	builtin_nlambda, @@ -210,6 +217,8 @@ enum ao_lisp_builtin_id {  	builtin_set,  	builtin_setq,  	builtin_cond, +	builtin_progn, +	builtin_while,  	builtin_print,  	builtin_patom,  	builtin_plus, | 
