feat: quote, nth

This commit is contained in:
2026-07-25 22:18:07 +02:00
parent 0e134957af
commit a789528026
4 changed files with 71 additions and 20 deletions
+9 -4
View File
@@ -13,6 +13,10 @@ static LispFunction special_forms[] = {
{
.name = (Nob_String_View){.count = 6, .data = "lambda"},
.apply = special_form_lambda,
},
{
.name = (Nob_String_View){.count = 5, .data = "quote"},
.apply = special_form_quote,
}};
static int scope_lookup(Scopes *scopes, Nob_String_View name, Node *result) {
@@ -49,16 +53,17 @@ void build_scopes(Scopes *scopes) {
scope_add_function(&global_scope, ">", builtin_gt);
scope_add_function(&global_scope, "<=", builtin_lt_eq);
scope_add_function(&global_scope, ">=", builtin_gt_eq);
scope_add_function(&global_scope, "floor", builtin_floor);
scope_add_function(&global_scope, "ceil", builtin_ceil);
scope_add_function(&global_scope, "println", builtin_println);
scope_add_function(&global_scope, "list", builtin_list);
scope_add_function(&global_scope, "append", builtin_append);
scope_add_function(&global_scope, "length", builtin_length);
scope_add_function(&global_scope, "null?", builtin_isnull);
scope_add_function(&global_scope, "builtins", builtin_builtins);
scope_add_function(&global_scope, "nth", builtin_nth);
scope_add_function(&global_scope, "floor", builtin_floor);
scope_add_function(&global_scope, "ceil", builtin_ceil);
scope_add_function(&global_scope, "println", builtin_println);
scope_add_function(&global_scope, "builtins", builtin_builtins);
nob_da_append(scopes, &global_scope);
}