From: Pete Halverson
Subject: Re: Q: setf and apply
Date: 
Message-ID: <4i1ra6$qi0@mystech.mystech.com>
In article <·················@hobbes.ISI.EDU>,
Thomas A. Russ <···@isi.edu> wrote:
>In article <...> ········@tasb.org (Bob Beal) writes:
> > (defstruct cmb x y z)
> > (setq c (make-cmb :x 5 :y 10 :z 15))
> > 
> > Now, can I do either of these to set the x slot to 9:
> > 
> > A: 
> > (setf (apply #'cmb-x c ()) 9)
>
>I don't think this is guaranteed to work by the standard.  Some Lisps
>may support it.  
>

A conforming CL implementation need only support

  (setf (apply #'AREF ..) newval)
  (setf (apply #'BIT ...) newval)
  (setf (apply #'SBIT ...) newval)

Implementations may also support other (APPLY #'fn) forms as SETF-able
places, but are not required to do so.

pch
From: Pete Halverson
Subject: Re: Q: setf and apply
Date: 
Message-ID: <4i3vog$g28@mystech.mystech.com>
In article <··········@gatekeeper.tasb.org>,Bob Beal <········@tasb.org> wrote:
-
-In article <··········@mystech.mystech.com>, ···@mystech.com (Pete Halverson) writes:
->
->A conforming CL implementation need only support
->
->  (setf (apply #'AREF ..) newval)
->  (setf (apply #'BIT ...) newval)
->  (setf (apply #'SBIT ...) newval)
->
->Implementations may also support other (APPLY #'fn) forms as SETF-able
->places, but are not required to do so.
->
-
-Are you sure about this?
-
-I thought (setf (apply #'cmb-x c ()) 9) *is* allowed by CLTL2.
-On page 127 it says under the entry to "apply": 
-
-...
-
-On page 125 it says setf allows for defstruct's:
-
-...

CLtL2 remains a classic reference text for CL, but it is an unofficial
"snapshot" of the CL design process that doesn't necessarily correspond to
the final draft of the language spec (and I don't know if Guy has the
interest or resources to do a CLtL3).  The ultimate word on questions like
these is the text of the ANSI standard itself, but it doesn't appear to be
in the current ANSI catalog, and it will probably be prohibitively
expensive for mere mortals to acquire anyway (e.g. the much smaller ANSI C
spec costs $130!).  For now, you can find the text of the draft standard at
<ftp://parcftp.xerox.com/pub/cl/dpANS3>.

There's also a new book out, "ANSI Common Lisp" (Paul Graham, Prentice
Hall, 1995), but I haven't seen it and don't know how comprehensive it is.
See <http://www.eecs.harvard.edu/onlisp/acl/> for blurb.

pch