 }
 
 object *sp_setf (object *args, object *env) {
-  checkargs(SETF, args); 
-  object **loc = place(SETF, first(args), env);
-  object *result = eval(second(args), env);
-  *loc = result;
-  return result;
+  object *arg = nil;
+  while (args != NULL) {
+    if (cdr(args) == NULL) error2(SETF, PSTR("odd number of parameters"));
+    object **loc = place(SETF, first(args), env);
+    arg = eval(second(args), env);
+    *loc = arg;
+    args = cddr(args);
+  }
+  return arg;
 }
 
 object *sp_dolist (object *args, object *env) {

  PinMode pm = INPUT;
  object *mode = second(args);
  if (integerp(mode)) {
    int nmode = checkinteger(PINMODE, mode);
    if (nmode == 1) pm = OUTPUT; else if (nmode == 2) pm = INPUT_PULLUP;
    #if defined(INPUT_PULLDOWN)
    else if (nmode == 4) pm = INPUT_PULLDOWN;

  if (args == NULL) return nil;
  object *more = cdr(args);
  while (more != NULL) {
    object *result = eval(car(args),env);
    if (tstflag(RETURNFLAG)) return result;
    args = more;
    more = cdr(args);
  }
