summaryrefslogtreecommitdiff
path: root/src/lisp/ao_lisp_mem.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2017-11-16 17:49:47 -0800
committerKeith Packard <keithp@keithp.com>2017-11-16 18:40:31 -0800
commitb3b4731fcb89cb404433f37a7704a503567c43bd (patch)
tree74f0a214725905c7556a735127f01a4b4b0926be /src/lisp/ao_lisp_mem.c
parentbd881a5b85d7cd4fb82127f92f32e089499b50cb (diff)
altos/lisp: Add scheme-style bools (#t and #f)
Cond and while compare against #f, just like scheme says to. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/lisp/ao_lisp_mem.c')
-rw-r--r--src/lisp/ao_lisp_mem.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lisp/ao_lisp_mem.c b/src/lisp/ao_lisp_mem.c
index d7c8d7a6..156221e8 100644
--- a/src/lisp/ao_lisp_mem.c
+++ b/src/lisp/ao_lisp_mem.c
@@ -211,6 +211,16 @@ static const struct ao_lisp_root ao_lisp_root[] = {
.type = &ao_lisp_cons_type,
.addr = (void **) &ao_lisp_read_stack,
},
+#ifdef AO_LISP_MAKE_CONST
+ {
+ .type = &ao_lisp_bool_type,
+ .addr = (void **) &ao_lisp_false,
+ },
+ {
+ .type = &ao_lisp_bool_type,
+ .addr = (void **) &ao_lisp_true,
+ },
+#endif
};
#define AO_LISP_ROOT (sizeof (ao_lisp_root) / sizeof (ao_lisp_root[0]))
@@ -447,6 +457,7 @@ static const struct ao_lisp_type *ao_lisp_types[AO_LISP_NUM_TYPE] = {
[AO_LISP_FRAME] = &ao_lisp_frame_type,
[AO_LISP_LAMBDA] = &ao_lisp_lambda_type,
[AO_LISP_STACK] = &ao_lisp_stack_type,
+ [AO_LISP_BOOL] = &ao_lisp_bool_type,
};
static int