case TC_VARIABLE:
{
SCHEME_OBJECT val = GET_VAL;
- long temp = (lookup_variable (GET_ENV, GET_EXP, (&val)));
+ SCHEME_OBJECT name = (GET_VARIABLE_SYMBOL (GET_EXP));
+ long temp = (lookup_variable (GET_ENV, name, (&val)));
if (temp != PRIM_DONE)
{
/* Back out of the evaluation. */
SCHEME_OBJECT val;
long code;
- if (!ENVIRONMENT_P (GET_VAL))
- POP_RETURN_ERROR (ERR_BAD_FRAME);
code = (lookup_variable (GET_VAL,
(MEMORY_REF (GET_EXP, ACCESS_NAME)),
(&val)));
case RC_EXECUTE_ASSIGNMENT_FINISH:
{
+ SCHEME_OBJECT variable = (MEMORY_REF (GET_EXP, ASSIGN_NAME));
SCHEME_OBJECT old_val;
long code;
POP_ENV ();
- code = (assign_variable (GET_ENV,
- (MEMORY_REF (GET_EXP, ASSIGN_NAME)),
- GET_VAL,
- (&old_val)));
+ if (TC_VARIABLE == (OBJECT_TYPE (variable)))
+ code = (assign_variable (GET_ENV,
+ (GET_VARIABLE_SYMBOL (variable)),
+ GET_VAL,
+ (&old_val)));
+ else
+ code = ERR_BAD_FRAME;
if (code == PRIM_DONE)
SET_VAL (old_val);
else
SCHEME_OBJECT * cell;
SCHEME_OBJECT value;
- if (!ENVIRONMENT_P (environment))
+ if (! ((ENVIRONMENT_P (environment)) && (SYMBOL_P (symbol))))
return (ERR_BAD_FRAME);
- cell
- = (find_binding_cell (environment,
- (((OBJECT_TYPE (symbol)) == TC_VARIABLE)
- ? (GET_VARIABLE_SYMBOL (symbol))
- : symbol),
- 0));
+ cell = (find_binding_cell (environment, symbol, 0));
if (cell == 0)
return (ERR_UNBOUND_VARIABLE);
assign_variable (SCHEME_OBJECT environment, SCHEME_OBJECT symbol,
SCHEME_OBJECT value, SCHEME_OBJECT * value_ret)
{
- if (!ENVIRONMENT_P (environment))
+ if (! ((ENVIRONMENT_P (environment)) || (SYMBOL_P (symbol))))
return (ERR_BAD_FRAME);
{
- SCHEME_OBJECT * cell
- = (find_binding_cell (environment,
- (((OBJECT_TYPE (symbol)) == TC_VARIABLE)
- ? (GET_VARIABLE_SYMBOL (symbol))
- : symbol),
- 0));
+ SCHEME_OBJECT * cell = (find_binding_cell (environment, symbol, 0));
if (cell == 0)
return (ERR_UNBOUND_VARIABLE);
return (assign_variable_end (cell, value, value_ret, 0));
define_variable (SCHEME_OBJECT environment, SCHEME_OBJECT symbol,
SCHEME_OBJECT value)
{
- if (!ENVIRONMENT_P (environment))
+ if (! ((ENVIRONMENT_P (environment)) || (SYMBOL_P (symbol))))
return (ERR_BAD_FRAME);
/* If there is already a binding, just assign to it. */
SCHEME_OBJECT * target_cell;
if (! ((ENVIRONMENT_P (target_environment))
- && (ENVIRONMENT_P (source_environment))))
+ && (ENVIRONMENT_P (source_environment))
+ && (SYMBOL_P (target_symbol))
+ && (SYMBOL_P (source_symbol))))
return (ERR_BAD_FRAME);
source_cell = (find_binding_cell (source_environment, source_symbol, 0));