Newsgroups: comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!newsfeed.pitt.edu!gatech!newsfeed.internetmci.com!in2.uu.net!netnews.jhuapl.edu!aplcenmp!hall
From: hall@aplcenmp.apl.jhu.edu (Marty Hall)
Subject: Re: Q: setf and structures
Message-ID: <DnLHJH.60K@aplcenmp.apl.jhu.edu>
Organization: JHU/APL Research Center, Hopkins P/T CS Faculty
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 15:26:05 GMT
Lines: 23

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))

This does not work in Allegro CL 4.2, Harlequin LispWorks 3.2.1, or
Lucid CL 4.1. I didn't check the dpANS to see if it is supposed to.

						- Marty
(proclaim '(inline skates))
http://www.apl.jhu.edu/~hall/lisp.html
