Re: COMPILE regression in Apr 2010 snapshot (?)

Madhu <[email protected]>
Newsgroups gmane.lisp.cmucl.devel
Message-ID <[email protected]>
* Raymond Toy <[email protected]> :
Wrote on Sun, 25 Apr 2010 23:29:54 -0400:

| On 4/24/10 3:42 AM, Madhu wrote:
|> Helu, here is an unpolished test case to show the problem:
|>
|>   -=-=-
|> (defmacro frob-keyvals-string (string)
|>   (with-input-from-string (stream string)
|>     `(progn ,@(loop for key = (let ((x (read stream nil stream)))
|> 				(if (eq x stream) (loop-finish) x))
|> 		    for val = (read stream)
|> 		    for comment = (read stream)
|> 		    collect (list 'defvar key (list 'quote val)
|> 				  (string comment))))))
|>
|> (frob-keyvals-string "
|> foo fooval foocomment
|> bar barval barcomment
|> car carval carcomment")
|>   
| This is caused by the macro expansion of defvar when the localization
| support was added.  Previously, we had
|
| (macroexpand '(defvar abc nil "abc")) ->
| (PROGN
|   (DECLAIM (SPECIAL ABC))
|   (UNLESS (BOUNDP 'ABC)
|     (SETQ ABC NIL))
|   (SETF (DOCUMENTATION 'ABC 'VARIABLE) '"abc")
|   (LISP::SET-DEFVAR-SOURCE-LOCATION 'ABC (C::SOURCE-LOCATION))
|   'ABC)
|
| We now have:
|
| (PROGN
|   (DECLAIM (SPECIAL ABC))
|   (UNLESS (BOUNDP 'ABC)
|     (SETQ ABC NIL))
|   (SETF (DOCUMENTATION 'ABC 'VARIABLE) '"abc")
|   (EVAL-WHEN (:LOAD-TOPLEVEL :EXECUTE)
|     (SETF (INFO VARIABLE INTL:TEXTDOMAIN 'ABC) NIL))
|   (LISP::SET-DEFVAR-SOURCE-LOCATION 'ABC (C::SOURCE-LOCATION))
|   'ABC)
|
| I do not understand it, but that (setf info) causes the problem.  When
| that is removed, cmucl behaves as it used to.  I don't understand why
| that would cause the macro to be compiled again.


My report may have been misleading: I do not think that macro is being
compiled again, it just looks that way from the notes that CMUCL prints.

I have not looked at the CMUCL code yet, but I my guess (without looking
at any commits) is that this is more likely related to some source
recording changes that may have been introduced.

--
Madhu
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.