[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

declare in with-slots

   Date: Tue, 2 Aug 88 13:51 PDT
   From: Gregor.pa@Xerox.COM
   Fcc: BD:>Gregor>mail>outgoing-mail-3.text.newest
   Line-Fold: no

   We never discussed how people could use declare inside of with-slots.  I
   don't think we ever thought of it.  But to at least one of my users,
   this is a serious bug.  Here is an idea for how to fix this.  I am not
   enough of a declaration expert to know if this can work.

   All of what I say here also applies to with-accessors.

   Allow declarartions to appear in front of the with-slots body.  These
   declarations affect the pseudo-bindings performed by the with slots.
   They talk about the value which will be returned by evaluating one of the
   pseudo variables and the values which will be stored in the pseudo
   variables.  The SPECIAL declaration is, of course, now allowed.

   So, for example:

   (with-slots (x y z) <instance>
     (declare (fixnum x y z))
     (setq z (* x y)))

The syntax makes sense.

   Note that I didn't layer this directly into symbol-macrolet.  We could
   of course put it there, but it seemed to me that it was more appropriate
   for this to be something which the caller of symbol-macrolet handles.  I
   could pretty easily be convinced that I am wrong about this.
I think that it has to be put in symbol-macrolet as well. If not, the work
that has to be done in with-slot is beig enough so the layering is totally
useless. Maybe making with-slots and with-accessors special forms and forget
about symbol-macrolet is a good solution. The context is narrower that we
originally proposed, so the semantics issue will be easier to nail down.