Changeset 5865


Ignore:
Timestamp:
02/18/04 15:30:32 (17 years ago)
Author:
piso
Message:

SETF: avoid using MULTIPLE-VALUE-BIND in the macro expansion unless we really
need to bind multiple values.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/setf.lisp

    r5680 r5865  
    22;;;
    33;;; Copyright (C) 2003-2004 Peter Graves
    4 ;;; $Id: setf.lisp,v 1.38 2004-02-03 02:15:25 piso Exp $
     4;;; $Id: setf.lisp,v 1.39 2004-02-18 15:30:32 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    9494              (when (symbolp (car place))
    9595                (resolve (car place)))
    96               (multiple-value-bind (dummies vals newval setter getter)
     96              (multiple-value-bind (dummies vals store-vars setter getter)
    9797                (get-setf-expansion place)
    9898                (let ((inverse (get (car place) 'setf-inverse)))
     
    101101                          `(funcall ,inverse ,@(cdr place) ,value-form)
    102102                          `(,inverse ,@(cdr place) ,value-form))
    103                       `(let* (,@(mapcar #'list dummies vals))
    104                          (multiple-value-bind ,newval ,value-form
    105                            ,setter)))))))))
     103                      (if (cdr store-vars)
     104                          `(let* (,@(mapcar #'list dummies vals))
     105                             (multiple-value-bind ,store-vars ,value-form
     106                               ,setter))
     107                          `(let* (,@(mapcar #'list dummies vals)
     108                                    ,(list (car store-vars) value-form))
     109                               ,setter)))))))))
    106110     ((oddp count)
    107111      (error "odd number of args to SETF"))
Note: See TracChangeset for help on using the changeset viewer.