summaryrefslogtreecommitdiff
path: root/modules/std_lib.c
diff options
context:
space:
mode:
authorFelix Perktold <Felix.Perktold@student.uibk.ac.at>2026-01-19 16:20:06 +0100
committerFelix Perktold <Felix.Perktold@student.uibk.ac.at>2026-01-19 16:20:06 +0100
commita5484c8bf3ac4c85f40ba0be5df036ce171cdc04 (patch)
tree5dbcbe9820faa6346d8dd43c78e24fe3dc4ebb75 /modules/std_lib.c
parent10d05ab14042636f4c5dcd1ad011a00052888276 (diff)
add list procedure
Diffstat (limited to 'modules/std_lib.c')
-rw-r--r--modules/std_lib.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/modules/std_lib.c b/modules/std_lib.c
index 182aac0..f87f2db 100644
--- a/modules/std_lib.c
+++ b/modules/std_lib.c
@@ -158,10 +158,15 @@ value *procedure_lt(env *e, value *args) {
return make_int(1);
}
+value *procedure_list(env *e, value *args) {
+ return eval(e, args);
+}
+
+
module_export *module_init() {
//exports[i].name = "xxx"
//exports[i].v = make_procedure(xxx);
- static module_export exports[12];
+ static module_export exports[13];
exports[0].name = "cons";
exports[0].v = make_procedure(procedure_cons);
@@ -185,9 +190,11 @@ module_export *module_init() {
exports[9].v = make_procedure(procedure_div);
exports[10].name = "<";
exports[10].v = make_procedure(procedure_lt);
+ exports[11].name = "list";
+ exports[11].v = make_procedure(procedure_list);
- exports[11].name = NULL;
- exports[11].v = NULL;
+ exports[12].name = NULL;
+ exports[12].v = NULL;
return exports;
}