Arithmatic

This commit is contained in:
2026-09-07 16:29:06 -07:00
parent df4ddcaf25
commit 5503b2f317
23 changed files with 554 additions and 31 deletions
+8
View File
@@ -30,6 +30,14 @@ bool list_length_eq(LispVal *list, intptr_t size) {
return size == 0 && NILP(list);
}
DEFUN(consp, "consp", (LispVal * val), "(val)", "") {
return CONSP(val) ? Qt : Qnil;
}
DEFUN(atom, "atom", (LispVal * val), "(val)", "") {
return ATOM(val) ? Qt : Qnil;
}
DEFUN(cons, "cons", (LispVal * car, LispVal *cdr), "(car cdr)",
"Construct a new cons object from CAR and CDR.") {
return CONS(car, cdr);