summaryrefslogtreecommitdiff
path: root/lisp.h
diff options
context:
space:
mode:
authorFelix Perktold <Felix.Perktold@student.uibk.ac.at>2026-01-18 14:21:34 +0100
committerFelix Perktold <Felix.Perktold@student.uibk.ac.at>2026-01-18 14:21:34 +0100
commitb86d3361836935297c6aedb0318ed8a34e4c52f0 (patch)
treec879fa3ce234be1625914cbcc5e1ab39f0955ba8 /lisp.h
parente6aeef5e54759c26912c4987cb86b3add2d77349 (diff)
refactor lisp.h into public lisp_api.h and internal lisp.h
Diffstat (limited to 'lisp.h')
-rw-r--r--lisp.h45
1 files changed, 0 insertions, 45 deletions
diff --git a/lisp.h b/lisp.h
index a422c9b..a972ecc 100644
--- a/lisp.h
+++ b/lisp.h
@@ -4,51 +4,6 @@
typedef struct value value;
typedef struct env env;
-typedef enum {
- VT_INT,
- VT_DOUBLE,
- VT_SYMBOL,
- VT_STRING,
- VT_NIL,
- VT_PAIR,
- VT_LAMBDA,
- VT_BUILTIN
-} val_type;
-
-struct value {
- val_type type;
- union {
- int i;
- double d;
- const char *sym;
- const char *str;
- struct {
- value *car;
- value *cdr;
- } pair;
- struct {
- value *params;
- value *body;
- env *env;
- } lambda;
- struct {
- value *(*fn) (env *, value *);
- } builtin;
- } as;
-};
-
-value *make_int(int i);
-value *make_double(double d);
-value *make_symbol(const char *sym);
-value *make_string(const char *str);
-value *make_nil();
-value *make_lambda(env *e, value *params, value *body);
-value *make_builtin(value *(*fn) (env *, value *));
-value *cons(value *car, value *cdr);
-value *car(value *cons);
-value *cdr(value *cons);
-value *reverse(value *list);
-
void print_value(value *val);
void println_value(value *val);
// environments, TODO: make this use hashtable