From 7b9c4a3ac265026d98624ac614eead866a190042 Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Mon, 10 Aug 2026 21:49:57 -0400 Subject: pit: VM-style evaluation --- pit/src/runtime/value/func.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'pit/src/runtime/value') diff --git a/pit/src/runtime/value/func.c b/pit/src/runtime/value/func.c index 3843553..5f88cb0 100644 --- a/pit/src/runtime/value/func.c +++ b/pit/src/runtime/value/func.c @@ -94,7 +94,8 @@ pit_value pit_value_func_lambda(pit_runtime *rt, pit_value args, pit_value body) } } arg_cells = pit_value_list_reverse(rt, arg_cells); - pit_value closure[4] = {env, arg_cells, arg_rest_nm, expanded}; + pit_value compiled = pit_vm_compile(rt, expanded); + pit_value closure[4] = {env, arg_cells, arg_rest_nm, compiled}; h->in.func.nm = PIT_NIL; h->in.func.closure = pit_value_array_from_buf(rt, closure, 4); return ret; @@ -153,7 +154,9 @@ pit_value pit_value_apply(pit_runtime *rt, pit_value f, pit_value args) { args = pit_value_cons_cdr(rt, args); anames = pit_value_cons_cdr(rt, anames); } - pit_value ret = pit_eval(rt, body); /* evaluate the body */ + /* TODO */ + pit_value ret = body; + // pit_value ret = pit_eval(rt, body); /* evaluate the body */ while (bound != PIT_NIL) { /* unbind everything we bound earlier, in reverse */ pit_symtab_unbind(rt, pit_value_cons_car(rt, bound)); bound = pit_value_cons_cdr(rt, bound); -- cgit v1.3.1