diff options
| author | LLLL Colonq <llll@colonq> | 2026-08-10 21:49:57 -0400 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2026-08-10 21:49:57 -0400 |
| commit | 7b9c4a3ac265026d98624ac614eead866a190042 (patch) | |
| tree | 2c5024583a047223ad7f5866d800554c9b81e191 /pit/src/runtime/value | |
| parent | d70a6e5310607a25aabde85d0aa18948704f8f6a (diff) | |
pit: VM-style evaluation
Diffstat (limited to 'pit/src/runtime/value')
| -rw-r--r-- | pit/src/runtime/value/func.c | 7 |
1 files changed, 5 insertions, 2 deletions
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); |
