add pic_eval

This commit is contained in:
Yuichi Nishiwaki 2014-03-03 22:23:10 +09:00
parent 464925d220
commit 408255381c
2 changed files with 11 additions and 0 deletions

View File

@ -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);

View File

@ -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());
}