[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

multiple-value-setf



     1.  *** Apropos --> `multiple-value-setf' <--
     
     system::multiple-value-setf    macro
     
     what does this macro do? may I guess? :)
     
     2. Apparently, multiple-value-bind is implemented using 
     multiple-value-list, thus it conses (or is it some sort of constant 
     list?) Is this a performance hit?
     
     3. Why isn't multiple-value-setf in the language?
     What's wrong with the following:
     
     (defmacro multiple-value-setf ((&rest exps) form)
       (let* ((vars (mapcar (lambda (xx) (gensym "MVSF")) exps))
         (combo (mapcan (lambda (xx vv) (list xx vv)) exps vars)))
         `(multiple-value-bind (,@vars) ,form
           (setf ,@combo))))
     
     (should it be
     #-:clisp
     (defmacro multiple-value-setf ((&rest exps) form)
       (let* ((vars (mapcar (lambda (xx) (gensym "MVSF")) exps))
         (combo (mapcan (lambda (xx vv) (list xx vv)) exps vars)))
         `(multiple-value-bind (,@vars) ,form
           (setf ,@combo))))
     #+:clisp
     (defmacro multiple-value-setf (&rest all)
       `(system::multiple-value-setf ,@all))
     ??)