add pic_funcall

This commit is contained in:
Yuichi Nishiwaki
2014-07-13 11:07:42 +09:00
parent 13fec26c59
commit fe375a7224
2 changed files with 14 additions and 0 deletions
+12
View File
@@ -444,6 +444,18 @@ pic_set(pic_state *pic, const char *name, pic_value value)
pic->globals[gid] = value;
}
pic_value
pic_funcall(pic_state *pic, const char *name, pic_list args)
{
pic_value proc;
proc = pic_ref(pic, name);
pic_assert_type(pic, proc, proc);
return pic_apply(pic, pic_proc_ptr(proc), args);
}
void
pic_defun(pic_state *pic, const char *name, pic_func_t cfunc)
{