Newsgroups: comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!newsfeed.pitt.edu!gatech!udel!news.mathworks.com!newsfeed.internetmci.com!howland.reston.ans.net!psinntp!psinntp!psinntp!psinntp!whirlaway!david
From: david@whirlaway.ci.com (David B. Kuznick)
Subject: Re: Q: setf and structures
Message-ID: <DnLJos.6qz@ci.com>
Sender: news@ci.com (News Administrator)
Organization: Cognition, Corp.
References: <4h0950$quo@gatekeeper.tasb.org> <DnHnrw.I4w@aplcenmp.apl.jhu.edu> <s08ka15bt8p.fsf@salmon.ICSI.Berkeley.EDU>
Distribution: inet
Date: Fri, 1 Mar 1996 16:12:27 GMT
Lines: 18

In article <s08ka15bt8p.fsf@salmon.ICSI.Berkeley.EDU>, marcoxa@salmon.icsi.berkeley.edu (Marco Antoniotti) writes:

|> Actually the #'(setf thing-x) works directly also for CL (at least
|> CMUCL which is CLtL2-ANSI friendly).
|> 
|> * (defstruct thing x y z)
|> THING
|> * (setq *things* (list (make-thing :x 5) (make-thing :x 10) (make-thing :x 15)))
|> (#S(THING :X 5 :Y NIL :Z NIL) #S(THING :X 10 :Y NIL :Z NIL)
|>  #S(THING :X 15 :Y NIL :Z NIL))
|> * (mapc #'(setf thing-x) '( 8 12 16) *things*)
|> (8 12 16)
|> * *things*
|> (#S(THING :X 8 :Y NIL :Z NIL) #S(THING :X 12 :Y NIL :Z NIL)
|>  #S(THING :X 16 :Y NIL :Z NIL))

It may work in CMUCL, but as far as I know it's not guaranteed to work in any
Common Lisp per se.
