From: John D. Burger
Subject: declarations in SETF methods
Date: 
Message-ID: <1991May29.203639.10177@linus.mitre.org>
Briefly, how can one make declarations that refer to the temporary
variables returned by a SETF method?

CLtL2 (and the draft standard) seem to say that declarations apply
only to variable bindings established by the containing form.  That
is, in the following

  (defun something (x)
    (let ((y (something-else)))
      (declare (ignore x))
      (et-cetera y)))

the IGNORE declaration does not apply to the formal parameter X.  By
the way, both Lucid and Allegro follow this; both compilers warn that
X is not used.  This seems perfectly reasonable.

However, consider SETF methods.  The temporary variables returned as
the first value of a SETF method "will be bound ... as if by LET*"
(CLtL2, p 140).  But the writer of the SETF method can't possibly
arrange for a declaration to appear at the head of that LET*, or
whatever form is actually going to be used.  So, she can't IGNORE the
variables, or declare type information.

It's the former that actually started this, since a recent question on
this group prompted me to write a SETF method for LET.  It required a
bogus temporary variable to be introduced, but I couldn't arrange for
the variable to be IGNOREd.  I can think of a dozen ways around this,
but a DECLARE would be most aesthetic.




--
John Burger                                               ยทยทยทยท@mitre.org

"You ever think about .signature files? I mean, do we really need them?"
  - alt.andy.rooney