home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!uwm.edu!linac!att!att!fang!tarpit!ge-dab!newshost.atl.ge.com!newshost.atl.ge.com!sjameson
- From: sjameson@atl.ge.com (Stephen M Jameson)
- Newsgroups: comp.lang.lisp
- Subject: Re: (SETF VALUES)
- Date: 11 Jan 93 14:53:37
- Organization: GE Advanced Technology Laboratories
- Lines: 41
- Message-ID: <SJAMESON.93Jan11145337@fergie.atl.ge.com>
- References: <1993Jan6.213139.27999@kronos.arc.nasa.gov>
- <FY.93Jan6155542@hardwick.lucid.com>
- <SJAMESON.93Jan8084615@fergie.atl.ge.com>
- <1imgf4INNmf@early-bird.think.com>
- Reply-To: sjameson@atl.ge.com
- NNTP-Posting-Host: retaxes.atl.ge.com
- In-reply-to: barmar@think.com's message of 9 Jan 93 12:29:24 GMT
-
- In article <1imgf4INNmf@early-bird.think.com> barmar@think.com (Barry Margolin) writes:
- > In article <SJAMESON.93Jan8084615@fergie.atl.ge.com> sjameson@atl.ge.com writes:
- > >In article <FY.93Jan6155542@hardwick.lucid.com> fy@lucid.com (Frank Yellin) writes:
- > >> > Is it possible to implement (SETF VALUES) in a Lisp which doesn't
- > >> > already do this?
- > >Pardon my ignorance here, but could you explain in what situations one would
- > >wish to do this?
- >
- > The normal multiple-value assignment operators only allow you to assign to
- > variables, but you might want to assign to a set of generalized references.
- > Here's a simple, contrived example:
- >
- > (defstruct (q-and-r (:conc-name qr-))
- > quotient
- > remainder)
- >
- > (defvar *qr* (make-q-and-r))
- > ...
- > (setf (values (qr-quotient *qr*) (qr-remainder *qr*))
- > (floor numerator denominator))
-
- Thank you, I understand now. I don't have a Cltl2 or draft standard handy, but
- isn't there such a thing as multiple-value-setf which would serve exactly this
- purpose?
-
-
- > --
- > Barry Margolin
- > System Manager, Thinking Machines Corp.
- >
- > barmar@think.com {uunet,harvard}!think!barmar
- --
- Steve Jameson General Electric Aerospace / Martin Marietta
- sjameson@atl.ge.com Advanced Technology Laboratories
- Moorestown, New Jersey
- ****************************************************************************
- ** . . . but I do not love the sword for its sharpness, nor the arrow **
- ** for its swiftness, nor the warrior for his glory. I love only that **
- ** which they defend . . . **
- ** -- Faramir, "The Two Towers" **
- ****************************************************************************
-