From: <wil...@ai...> - 2007-07-22 12:43:26
|
Robert Strandh sent this report to sbcl-devel-owner, evidently since the lists are closed to nonsubscribers. I expect I'll be fielding stuff like this from time to time now. Those who've sent >40kbyte messages to the lists in the past can guess that I usually won't be any more lightning-quick at it than on this message. ----- Forwarded message from Robert Strandh <st...@la...> ----- To: sbc...@li... Subject: Bug report: macro expansion + note about the result Hello, The following code: CL-USER> (defgeneric (setf bla) (new-value bla &key whatever)) #<STANDARD-GENERIC-FUNCTION (SETF BLA) (0)> CL-USER> (defun hmm (x y z) (setf (bla x :whatever y) z)) Gives the following note: ; in: LAMBDA NIL ; (SETF (BLA X :WHATEVER Y) Z) ; --> LET* MULTIPLE-VALUE-BIND LET FUNCALL SB-C::%FUNCALL ; ==> ; (#<SB-C::GLOBAL-VAR ; :%SOURCE-NAME (SETF BLA) ; :TYPE #<SB-KERNEL:FUN-TYPE (FUNCTION # *)> ; :WHERE-FROM :DECLARED ; :KIND :GLOBAL-FUNCTION {10070DEDD1}> ; #:G0 #:G3 #:G2 #:G1) ; ; note: The third argument (in keyword position) is not a constant. ; ; compilation unit finished ; printed 1 note The problem seems to be that the macro expansion of: (setf (bla x :whatever y) z) is something similar to (funcall #'(setf bla) #:G0 #:G3 #:G2 #:G1) where #:G2 is bound to the keyword :whatever. Now, since #:G2 is a variable, the compiler emits a note because it is not very common to have a variable in a keyword position. Thanks in advance, -- Robert Strandh --------------------------------------------------------------------- Greenspun's Tenth Rule of Programming: any sufficiently complicated C or Fortran program contains an ad hoc informally-specified bug-ridden slow implementation of half of Common Lisp. --------------------------------------------------------------------- ----- End forwarded message ----- -- William Harold Newman <wil...@ai...> PGP key fingerprint 85 CE 1C BA 79 8D 51 8C B9 25 FB EE E0 C3 E5 7C Ubi saeva indignatio ulterius cor lacerare nequit. -- Jonathan Swift's epitaph |