aboutsummaryrefslogtreecommitdiff
path: root/alisp.h
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2025-08-21 14:54:57 +0100
committerAryadev Chavali <aryadev@aryadevchavali.com>2025-08-21 14:55:54 +0100
commit0f68afd9a040256939ddd082a380bd37b0a3996b (patch)
tree2c59292ca62bfe70a09b7e7efadfcc756b0914c6 /alisp.h
parent742f19886cce986d0d01606b07dd533fbffe2cdd (diff)
downloadalisp-0f68afd9a040256939ddd082a380bd37b0a3996b.tar.gz
alisp-0f68afd9a040256939ddd082a380bd37b0a3996b.tar.bz2
alisp-0f68afd9a040256939ddd082a380bd37b0a3996b.zip
Make nicer primitive functions for car/cdr
If it isn't a CONS, we return NIL instead of failing. This way, we can use it in our general iteration functions. Eventually the actual runtime would use this as well. The macros are mostly for internal use to do assignment etc.
Diffstat (limited to 'alisp.h')
-rw-r--r--alisp.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/alisp.h b/alisp.h
index c3d25c3..e9694d9 100644
--- a/alisp.h
+++ b/alisp.h
@@ -126,6 +126,9 @@ vec_t *as_vec(lisp_t *);
#define CAR(L) (as_cons(L)->car)
#define CDR(L) (as_cons(L)->cdr)
+lisp_t *car(lisp_t *);
+lisp_t *cdr(lisp_t *);
+
/// Pointer tagging scheme for lisps
typedef enum Tag