don't use pic_defvar

This commit is contained in:
Yuichi Nishiwaki 2014-07-12 22:20:49 +09:00
parent fe375a7224
commit 05309a1d38
4 changed files with 15 additions and 13 deletions

View File

@ -141,7 +141,6 @@ struct pic_proc *pic_get_proc(pic_state *);
int pic_get_args(pic_state *, const char *, ...);
void pic_defun(pic_state *, const char *, pic_func_t);
void pic_defmacro(pic_state *, const char *, struct pic_proc *);
void pic_defvar(pic_state *, const char *, pic_value);
bool pic_equal_p(pic_state *, pic_value, pic_value);

View File

@ -950,6 +950,16 @@
;;; 6.13. Input and output
(import (picrin port))
(define current-input-port (make-parameter standard-input-port))
(define current-output-port (make-parameter standard-output-port))
(define current-error-port (make-parameter standard-error-port))
(export current-input-port
current-output-port
current-error-port)
(define (call-with-port port proc)
(dynamic-wind
(lambda () #f)

View File

@ -684,9 +684,11 @@ pic_port_flush(pic_state *pic)
void
pic_init_port(pic_state *pic)
{
pic_defvar(pic, "current-input-port", port_new_stdport(pic, xstdin, PIC_PORT_IN));
pic_defvar(pic, "current-output-port", port_new_stdport(pic, xstdout, PIC_PORT_OUT));
pic_defvar(pic, "current-error-port", port_new_stdport(pic, xstderr, PIC_PORT_OUT));
pic_deflibrary ("(picrin port)") {
pic_define(pic, "standard-input-port", port_new_stdport(pic, xstdin, PIC_PORT_IN));
pic_define(pic, "standard-output-port", port_new_stdport(pic, xstdout, PIC_PORT_OUT));
pic_define(pic, "standard-error-port", port_new_stdport(pic, xstderr, PIC_PORT_OUT));
}
pic_defun(pic, "input-port?", pic_port_input_port_p);
pic_defun(pic, "output-port?", pic_port_output_port_p);

View File

@ -465,15 +465,6 @@ pic_defun(pic_state *pic, const char *name, pic_func_t cfunc)
pic_define(pic, name, pic_obj_value(proc));
}
void
pic_defvar(pic_state *pic, const char *name, pic_value init)
{
struct pic_var *var;
var = pic_var_new(pic, init, NULL);
pic_define(pic, name, pic_obj_value(pic_wrap_var(pic, var)));
}
static void
vm_push_env(pic_state *pic)
{