From 96d75b3c06170e21681185482c1cd0fa684b3ed3 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Sun, 10 Nov 2013 00:41:59 +0900 Subject: [PATCH] add apply function --- src/proc.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/proc.c b/src/proc.c index 05f03537..d27e7774 100644 --- a/src/proc.c +++ b/src/proc.c @@ -36,8 +36,19 @@ pic_proc_proc_p(pic_state *pic) return pic_bool_value(pic_proc_p(v)); } +static pic_value +pic_proc_apply(pic_state *pic) +{ + pic_value proc, args; + + pic_get_args(pic, "oo", &proc, &args); + + return pic_apply(pic, pic_proc_ptr(proc), args); +} + void pic_init_proc(pic_state *pic) { pic_defun(pic, "procedure?", pic_proc_proc_p); + pic_defun(pic, "apply", pic_proc_apply); }