HACK: flat-variable.
This commit is contained in:
parent
7f7b823175
commit
0de228a0d6
|
@ -173,6 +173,7 @@ struct scm *struct_ref (struct scm *x, struct scm *i);
|
||||||
struct scm *struct_set_x (struct scm *x, struct scm *i, struct scm *e);
|
struct scm *struct_set_x (struct scm *x, struct scm *i, struct scm *e);
|
||||||
/* src/variable.c */
|
/* src/variable.c */
|
||||||
struct scm *variable_ref (struct scm *var);
|
struct scm *variable_ref (struct scm *var);
|
||||||
|
struct scm *flat_variable_ref (struct scm *var);
|
||||||
struct scm *variable_set_x (struct scm *var, struct scm *value);
|
struct scm *variable_set_x (struct scm *var, struct scm *value);
|
||||||
struct scm *variable_bound_p (struct scm *var);
|
struct scm *variable_bound_p (struct scm *var);
|
||||||
struct scm *lookup_variable (struct scm *lookup, struct scm *name, struct scm *define_p);
|
struct scm *lookup_variable (struct scm *lookup, struct scm *name, struct scm *define_p);
|
||||||
|
|
|
@ -283,6 +283,7 @@ mes_builtins (struct scm *a) /*:((internal)) */
|
||||||
a = init_builtin (builtin_type, "struct-set!", 3, &struct_set_x, a);
|
a = init_builtin (builtin_type, "struct-set!", 3, &struct_set_x, a);
|
||||||
/* src/variable.c */
|
/* src/variable.c */
|
||||||
a = init_builtin (builtin_type, "variable-ref", 1, &variable_ref, a);
|
a = init_builtin (builtin_type, "variable-ref", 1, &variable_ref, a);
|
||||||
|
a = init_builtin (builtin_type, "flat-variable-ref", 1, &flat_variable_ref, a);
|
||||||
a = init_builtin (builtin_type, "variable-set!", 2, &variable_set_x, a);
|
a = init_builtin (builtin_type, "variable-set!", 2, &variable_set_x, a);
|
||||||
a = init_builtin (builtin_type, "variable-bound?", 1, &variable_bound_p, a);
|
a = init_builtin (builtin_type, "variable-bound?", 1, &variable_bound_p, a);
|
||||||
a = init_builtin (builtin_type, "lookup-variable", 3, &lookup_variable, a);
|
a = init_builtin (builtin_type, "lookup-variable", 3, &lookup_variable, a);
|
||||||
|
|
|
@ -32,6 +32,16 @@ variable_ref (struct scm *var)
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct scm *
|
||||||
|
flat_variable_ref (struct scm *var)
|
||||||
|
{
|
||||||
|
assert_variable (1, var);
|
||||||
|
struct scm *value = var->variable;
|
||||||
|
if (value == cell_undefined)
|
||||||
|
error (cell_symbol_unbound_variable, var);
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
struct scm *
|
struct scm *
|
||||||
variable_set_x (struct scm *var, struct scm *value)
|
variable_set_x (struct scm *var, struct scm *value)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue