core: Remove set-env! as builtin.
* src/eval-apply.c (set_x): Rename from set_env_x. Drop environment parameter. * include/mes/mes.h: Declare it. * include/mes/builtins.h (set_env_x): Remove declaration. * src/builtins.c (mes_builtins): Remove registration.
This commit is contained in:
parent
629698e172
commit
b7705b49c7
|
@ -53,7 +53,6 @@ struct scm *write_port_ (struct scm *x, struct scm *p);
|
|||
struct scm *pairlis (struct scm *x, struct scm *y, struct scm *a);
|
||||
struct scm *set_car_x (struct scm *x, struct scm *e);
|
||||
struct scm *set_cdr_x (struct scm *x, struct scm *e);
|
||||
struct scm *set_env_x (struct scm *x, struct scm *e, struct scm *a);
|
||||
struct scm *add_formals (struct scm *formals, struct scm *x);
|
||||
struct scm *eval_apply ();
|
||||
/* src/gc.c */
|
||||
|
|
|
@ -147,6 +147,7 @@ struct scm *make_string_port (struct scm *x);
|
|||
struct scm *make_vector_ (long k, struct scm *e);
|
||||
struct scm *mes_builtins (struct scm *a);
|
||||
struct scm *push_cc (struct scm *p1, struct scm *p2, struct scm *a, struct scm *c);
|
||||
struct scm *set_x (struct scm *x, struct scm *e);
|
||||
struct scm *struct_ref_ (struct scm *x, long i);
|
||||
struct scm *struct_set_x_ (struct scm *x, long i, struct scm *e);
|
||||
struct scm *vector_ref_ (struct scm *x, long i);
|
||||
|
|
|
@ -163,7 +163,6 @@ mes_builtins (struct scm *a) /*:((internal)) */
|
|||
a = init_builtin (builtin_type, "pairlis", 3, &pairlis, a);
|
||||
a = init_builtin (builtin_type, "set-car!", 2, &set_car_x, a);
|
||||
a = init_builtin (builtin_type, "set-cdr!", 2, &set_cdr_x, a);
|
||||
a = init_builtin (builtin_type, "set-env!", 3, &set_env_x, a);
|
||||
a = init_builtin (builtin_type, "add-formals", 2, &add_formals, a);
|
||||
a = init_builtin (builtin_type, "eval-apply", 0, &eval_apply, a);
|
||||
/* src/gc.c */
|
||||
|
|
|
@ -113,14 +113,14 @@ set_cdr_x (struct scm *x, struct scm *e)
|
|||
}
|
||||
|
||||
struct scm *
|
||||
set_env_x (struct scm *x, struct scm *e, struct scm *a)
|
||||
set_x (struct scm *x, struct scm *e) /*:((internal)) */
|
||||
{
|
||||
struct scm *p;
|
||||
if (x->type == TVARIABLE)
|
||||
p = x->variable;
|
||||
else
|
||||
{
|
||||
p = lookup_variable (a, x, cell_f);
|
||||
p = lookup_variable (R0, x, cell_f);
|
||||
if (p == cell_f || p-> cdr == cell_undefined)
|
||||
error (cell_symbol_unbound_variable, x);
|
||||
}
|
||||
|
@ -577,7 +577,7 @@ eval:
|
|||
push_cc (R1->cdr->cdr->car, R1, R0, cell_vm_eval_set_x);
|
||||
goto eval;
|
||||
eval_set_x:
|
||||
R1 = set_env_x (R2->cdr->car, R1, R0);
|
||||
R1 = set_x (R2->cdr->car, R1);
|
||||
goto vm_return;
|
||||
}
|
||||
else if (c == cell_vm_macro_expand)
|
||||
|
|
Loading…
Reference in New Issue