MULTIPLE-VALUE-SETQ must output _only_ the primary value.

This commit is contained in:
jjgarcia 2005-10-24 08:33:52 +00:00
parent 5643e40059
commit bfceb89a55
3 changed files with 12 additions and 5 deletions

View file

@ -7,6 +7,8 @@ ECL 0.9h
high level routines (VECTOR-PUSH-EXTEND) to handle the vector of weak
pointers to the files.
- MULTIPLE-VALUE-SETQ must output only the primary value.
* Design:
- Simplified the structure of the frame stack, removing redundant fields.

View file

@ -1368,7 +1368,7 @@ static int
c_multiple_value_setq(cl_object orig_args, int flags) {
cl_object args = orig_args;
cl_object orig_vars;
cl_object vars = Cnil;
cl_object vars = Cnil, values;
cl_object old_variables = ENV->variables;
cl_index nvars = 0;
@ -1394,12 +1394,14 @@ c_multiple_value_setq(cl_object orig_args, int flags) {
}
/* Compile values */
compile_form(pop(&args), FLAG_VALUES);
values = pop(&args);
if (args != Cnil)
FEprogram_error("MULTIPLE-VALUE-SETQ: Too many arguments.", 0);
if (nvars == 0)
if (nvars == 0) {
/* No variables */
return flags;
return compile_form(cl_list(2, @'values', values), flags);
}
compile_form(values, FLAG_VALUES);
/* Compile variables */
asm_op2(OP_MSETQ, nvars);

View file

@ -540,7 +540,10 @@ interpret_msetq(cl_object bytecodes, cl_opcode *vector)
ECL_SETQ(name, value);
}
}
if (NVALUES > 1) NVALUES = 1;
if (NVALUES == 0) {
VALUES(0) = Cnil;
}
NVALUES = 1;
return vector;
}