Add lots of utilties, initial builtins

This commit is contained in:
2022-10-27 16:51:21 -04:00
parent 07a486cd16
commit d81d8c5156
11 changed files with 603 additions and 10 deletions

29
src/evaluate.c Normal file
View File

@@ -0,0 +1,29 @@
#include <assert.h>
#include <stddef.h>
#include "nihilispm.h"
struct nl_object *nl_evaluate_list(struct nl_object *list) {
return NULL;
}
struct nl_object *nl_evaluate_symbol(struct nl_object *symbol) {
return NULL;
}
struct nl_object *nl_evaluate(struct nl_object *obj) {
assert(obj != NULL);
switch (obj->type) {
case NL_TYPE_CELL:
return nl_evaluate_list(obj);
case NL_TYPE_SYMBOL:
return NULL; //nl_evalute_symbol(obj);
case NL_TYPE_INT:
case NL_TYPE_STRING:
return obj;
case NL_TYPE_COUNT:
assert(0);
return NULL;
}
}