add pic_eval
This commit is contained in:
parent
464925d220
commit
408255381c
|
@ -181,6 +181,7 @@ pic_value pic_load(pic_state *, const char *);
|
||||||
pic_value pic_apply(pic_state *, struct pic_proc *, pic_value);
|
pic_value pic_apply(pic_state *, struct pic_proc *, pic_value);
|
||||||
pic_value pic_apply_argv(pic_state *, struct pic_proc *, size_t, ...);
|
pic_value pic_apply_argv(pic_state *, struct pic_proc *, size_t, ...);
|
||||||
pic_value pic_apply_trampoline(pic_state *, struct pic_proc *, pic_value);
|
pic_value pic_apply_trampoline(pic_state *, struct pic_proc *, pic_value);
|
||||||
|
pic_value pic_eval(pic_state *, pic_value);
|
||||||
struct pic_proc *pic_compile(pic_state *, pic_value);
|
struct pic_proc *pic_compile(pic_state *, pic_value);
|
||||||
pic_value pic_macroexpand(pic_state *, pic_value);
|
pic_value pic_macroexpand(pic_state *, pic_value);
|
||||||
|
|
||||||
|
|
10
src/vm.c
10
src/vm.c
|
@ -873,3 +873,13 @@ pic_apply_trampoline(pic_state *pic, struct pic_proc *proc, pic_value args)
|
||||||
ci->fp = fp - 1; /* the last argument is pushed by the VM */
|
ci->fp = fp - 1; /* the last argument is pushed by the VM */
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pic_value
|
||||||
|
pic_eval(pic_state *pic, pic_value program)
|
||||||
|
{
|
||||||
|
struct pic_proc *proc;
|
||||||
|
|
||||||
|
proc = pic_compile(pic, program);
|
||||||
|
|
||||||
|
return pic_apply(pic, proc, pic_nil_value());
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue