add identifier-variable and identifier-environment
This commit is contained in:
parent
181d120f09
commit
25c0eb125e
|
@ -490,6 +490,30 @@ pic_macro_make_identifier(pic_state *pic)
|
|||
return pic_obj_value(pic_make_id(pic, var, pic_env_ptr(env)));
|
||||
}
|
||||
|
||||
static pic_value
|
||||
pic_macro_identifier_variable(pic_state *pic)
|
||||
{
|
||||
pic_value id;
|
||||
|
||||
pic_get_args(pic, "o", &id);
|
||||
|
||||
pic_assert_type(pic, id, id);
|
||||
|
||||
return pic_id_ptr(id)->var;
|
||||
}
|
||||
|
||||
static pic_value
|
||||
pic_macro_identifier_environment(pic_state *pic)
|
||||
{
|
||||
pic_value id;
|
||||
|
||||
pic_get_args(pic, "o", &id);
|
||||
|
||||
pic_assert_type(pic, id, id);
|
||||
|
||||
return pic_obj_value(pic_id_ptr(id)->env);
|
||||
}
|
||||
|
||||
static pic_value
|
||||
pic_macro_variable_p(pic_state *pic)
|
||||
{
|
||||
|
@ -526,8 +550,10 @@ pic_macro_variable_eq_p(pic_state *pic)
|
|||
void
|
||||
pic_init_macro(pic_state *pic)
|
||||
{
|
||||
pic_defun(pic, "identifier?", pic_macro_identifier_p);
|
||||
pic_defun(pic, "make-identifier", pic_macro_make_identifier);
|
||||
pic_defun(pic, "identifier?", pic_macro_identifier_p);
|
||||
pic_defun(pic, "identifier-variable", pic_macro_identifier_variable);
|
||||
pic_defun(pic, "identifier-environment", pic_macro_identifier_environment);
|
||||
|
||||
pic_defun(pic, "variable?", pic_macro_variable_p);
|
||||
pic_defun(pic, "variable=?", pic_macro_variable_eq_p);
|
||||
|
|
|
@ -239,9 +239,13 @@
|
|||
(export make-parameter
|
||||
parameterize)
|
||||
|
||||
(export identifier?
|
||||
identifier=?
|
||||
make-identifier)
|
||||
(export make-identifier
|
||||
identifier?
|
||||
identifier-variable
|
||||
identifier-environment
|
||||
|
||||
variable?
|
||||
variable=?)
|
||||
|
||||
(export call-with-current-continuation
|
||||
call/cc
|
||||
|
|
Loading…
Reference in New Issue