home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / lisp / 3228 < prev    next >
Encoding:
Internet Message Format  |  1993-01-12  |  1.4 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!darwin.sura.net!newsserver.jvnc.net!yale.edu!ira.uka.de!rz.uni-karlsruhe.de!ma2s3!haible
  2. From: haible@ma2s3.uucp (Bruno Haible)
  3. Newsgroups: comp.lang.lisp
  4. Subject: Re: (SETF VALUES)
  5. Date: 12 Jan 1993 15:50:58 GMT
  6. Organization: University of Karlsruhe, Germany
  7. Lines: 26
  8. Sender: <haible@ma2s2.mathematik.uni-karlsruhe.de>
  9. Message-ID: <1iupd2INN42h@nz12.rz.uni-karlsruhe.de>
  10. References: <SJAMESON.93Jan8084615@fergie.atl.ge.com> <1imgf4INNmf@early-bird.think.com> <SJAMESON.93Jan11145337@fergie.atl.ge.com>
  11. NNTP-Posting-Host: ma2s3.mathematik.uni-karlsruhe.de
  12. Summary: multiple-value-setq obsolete
  13. Keywords: places, multiple-value-setq, let
  14.  
  15. sjameson@atl.ge.com writes:
  16. > Thank you, I understand now. I don't have a Cltl2 or draft standard handy, but
  17. > isn't there such a thing as multiple-value-setf which would serve exactly this
  18. > purpose? 
  19.  
  20. There is MULTIPLE-VALUE-SETQ, but this one only handles symbols as places.
  21. The good thing about the (VALUES ...) place is that it makes
  22. MULTIPLE-VALUE-SETQ obsolete. You can also write macros LETF and LETF* that
  23. make MULTIPLE-VALUE-BIND obsolete. You can then write
  24.  
  25. (letf* (((values x y) (values (car l) (cdr l)))
  26.         ((values q r) (floor x y)))
  27.   (foo q r)
  28. )
  29.  
  30. which expands into
  31.  
  32. (let ((x (car l)) (y (cdr l)))
  33.   (multiple-value-bind (q r) (floor x y)
  34.     (foo q r)
  35. ) )
  36.  
  37.  
  38. Bruno Haible
  39. haible@ma2s2.mathematik.uni-karlsruhe.de
  40.  
  41.