add procedure?
This commit is contained in:
parent
c782912212
commit
51253c00b9
|
@ -6,6 +6,7 @@ void pic_init_number(pic_state *);
|
|||
void pic_init_time(pic_state *);
|
||||
void pic_init_system(pic_state *);
|
||||
void pic_init_file(pic_state *);
|
||||
void pic_init_proc(pic_state *);
|
||||
|
||||
#define DONE pic_gc_arena_restore(pic, ai);
|
||||
|
||||
|
@ -21,4 +22,5 @@ pic_init_core(pic_state *pic)
|
|||
pic_init_time(pic); DONE;
|
||||
pic_init_system(pic); DONE;
|
||||
pic_init_file(pic); DONE;
|
||||
pic_init_proc(pic); DONE;
|
||||
}
|
||||
|
|
16
src/proc.c
16
src/proc.c
|
@ -27,3 +27,19 @@ pic_proc_new_cfunc(pic_state *pic, pic_func_t cfunc, pic_value aux)
|
|||
proc->aux = aux;
|
||||
return proc;
|
||||
}
|
||||
|
||||
static pic_value
|
||||
pic_proc_proc_p(pic_state *pic)
|
||||
{
|
||||
pic_value v;
|
||||
|
||||
pic_get_args(pic, "o", &v);
|
||||
|
||||
return pic_bool_value(pic_proc_p(v));
|
||||
}
|
||||
|
||||
void
|
||||
pic_init_proc(pic_state *pic)
|
||||
{
|
||||
pic_defun(pic, "procedure?", pic_proc_proc_p);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue