summaryrefslogtreecommitdiff
path: root/lisp.c
diff options
context:
space:
mode:
authorFelix Perktold <Felix.Perktold@student.uibk.ac.at>2026-01-18 17:44:10 +0100
committerFelix Perktold <Felix.Perktold@student.uibk.ac.at>2026-01-18 17:44:10 +0100
commit07cd615c7e1cafccd6d46b3eb68d413f2a2dd9a5 (patch)
tree540292fc4029265628ea7e4d2d750c21c267a85b /lisp.c
parenta2ab90cfb9e364a3de7157b2ea2905e4c944583d (diff)
start writing psql module, start writing exercise 1 with that module, small header file changes as needed for module programming
Diffstat (limited to 'lisp.c')
-rw-r--r--lisp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lisp.c b/lisp.c
index 8b9f3ad..88ff472 100644
--- a/lisp.c
+++ b/lisp.c
@@ -26,14 +26,14 @@ value *make_double(double d) {
value *make_symbol(const char *s) {
value *val = malloc(sizeof(value));
val->type = VT_SYMBOL;
- val->as.sym = s;
+ val->as.sym = strdup(s);
return val;
}
value *make_string(const char *s) {
value *val = malloc(sizeof(value));
val->type = VT_STRING;
- val->as.str = s;
+ val->as.str = strdup(s);
return val;
}
@@ -518,7 +518,7 @@ value *procedure_load_module(env *e, value *args) {
env_define(e, exports[i].name, exports[i].v);
}
- return make_nil();
+ return make_int(1);
}
int is_integer(double x) {