applicable var

This commit is contained in:
Yuichi Nishiwaki 2014-07-23 09:05:35 +09:00
parent f7bbe31ee5
commit e3887691d2
1 changed files with 9 additions and 0 deletions

View File

@ -712,6 +712,15 @@ pic_apply(pic_state *pic, struct pic_proc *proc, pic_value argv)
L_CALL: L_CALL:
x = pic->sp[-c.u.i]; x = pic->sp[-c.u.i];
if (! pic_proc_p(x)) { if (! pic_proc_p(x)) {
if (pic_var_p(x)) {
if (c.u.i != 1) {
pic_errorf(pic, "invalid call-sequence for var object");
}
POP();
PUSH(pic_var_ref(pic, pic_var_ptr(x)));
NEXT;
}
pic_errorf(pic, "invalid application: ~s", x); pic_errorf(pic, "invalid application: ~s", x);
} }
proc = pic_proc_ptr(x); proc = pic_proc_ptr(x);