Add primitive procedures to expression type

This commit is contained in:
2025-08-10 14:37:40 +01:00
parent 3f871d2b43
commit 472a682757
5 changed files with 55 additions and 2 deletions

View File

@@ -44,3 +44,12 @@ expr_t *expr_pair(store_t *store, expr_t *car, expr_t *cdr)
expr->pair.cdr = cdr;
return expr;
}
expr_t *expr_prim_proc(store_t *store, prim_proc_t prim_proc)
{
expr_t *expr = store_alloc(store);
expr->is_atom = true;
expr->atom.type = ATOM_TYPE_PRIM_PROC;
expr->atom.prim_proc = prim_proc;
return expr;
}