diff options
author | Keith Packard <keithp@keithp.com> | 2016-11-10 11:30:55 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2016-11-17 22:18:39 -0800 |
commit | fd7df330470c7c2f12ca3ce28d920c3b278108d5 (patch) | |
tree | 5dd18087ba3f8ab38790ad88eedce3334d276652 /src/lisp/ao_lisp.h | |
parent | a3535e28a74055c3b303dbb4111cb3d38c2817e2 (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, |