Subject: Re: bogus change(s) in cl-macs.el - msg#00024
List: emacs.w3m
>
First of all, I protest strongly that such a big change has not
>
been recorded on the ChangeLog file.
The ChangeLog is somewhere, but as usual I forgot to commit it at the time
and now I'm working on another computer. But trust me, it's not lost.
>
*** cl-macs.el~ Tue Nov 16 21:54:14 2004
>
--- cl-macs.el Fri Nov 19 01:30:39 2004
>
***************
>
*** 1314,1320 ****
>
\(fn ((FUNC ARGLIST BODY...) ...) FORM...)"
>
(let ((vars nil) (sets nil) (cl-macro-environment cl-macro-environment))
>
(while bindings
>
! (let ((var (make-symbol "--cl-var--")))
>
(push var vars)
>
(push (list 'function* (cons 'lambda (cdar bindings))) sets)
>
(push var sets)
>
--- 1314,1320 ----
>
\(fn ((FUNC ARGLIST BODY...) ...) FORM...)"
>
(let ((vars nil) (sets nil) (cl-macro-environment cl-macro-environment))
>
(while bindings
>
! (let ((var (gensym)))
>
(push var vars)
>
(push (list 'function* (cons 'lambda (cdar bindings))) sets)
>
(push var sets)
It's odd that such a change would fix/break some code.
After all `gensym' is more or less doing (make-symbol (concat "G"
(random))), so other than the symbol's name, nothing is changed.
And since the symbol is uninterned, its name is mostly irrelevant, unless
some code later on uses `symbol-name' or does a print+read without using
print-gensym.
Maybe we'll indeed have to revert to gensym here, but I'd like to first
better understand the problem.
Could you give us a recipe to reproduce the problem, and a backtrace
if applicable. Of course, ideally the recipe should not use emacs-w3m,
but as a first step it would still help to see a recipe and a description of
the resulting problem.
Stefan
Was this page helpful?
Thread at a glance:
Previous Message by Date:
click to view message preview
Re: bogus change(s) in cl-macs.el
> I myself suggested the following alternate type solution, which I
> believe would not have broken anything:
>
> ! (let ((var (with-no-warnings (gensym))))
As well as being unclean, that doesn't solve the problem of gensym
being undefined at runtime.
`gensym' _only_ needs to be defined at runtime when gensym is going to
be _called_ at runtime. I said that I still had to double check my
alternative patch should it be needed. I did check in the `winner'
case that `gensym' was _not_ called at runtime. I would strongly
guess that this is the case with _all_ these calls to `gensym'.
Clearly, I would have to _check_ that this is really the case.
All of this only matters if there are real problems with Stefan's patch.
Sincerely,
Luc.
Next Message by Date:
click to view message preview
[emacs-w3m:07185] Re: bogus change(s) in cl-macs.el
>>>>>> In [emacs-w3m : No.07180] Miles Bader wrote:
>> Please describe this "breakage" in greater detail.
>>>>> In [emacs-w3m : No.07182] Katsumi Yamaoka wrote:
> From yesterday I'm looking for a simpler way rather than to use
> emacs-w3m to reproduce the bug. However, it has not been
> achieved so far. I'll post it when I found it.
I found the simplest way to explain the bug:
(macroexpand
'(labels ((FOO nil FOO-BODY)
(BAR nil BAR-BODY))
(FOO)
(BAR)))
(let ((--cl---cl-var---- nil)
(--cl---cl-var---- nil))
(progn
(progn
(set '--cl---cl-var---- #'(lambda nil BAR-BODY))
(set '--cl---cl-var---- #'(lambda nil FOO-BODY)))
(funcall (symbol-value '--cl---cl-var----))
(funcall (symbol-value '--cl---cl-var----))))
One of two functions FOO and BAR is disregarded as you see.
When the patch I posted is applied, it will be corrected as
follows:
(let ((--cl-G79813-- nil)
(--cl-G79812-- nil))
(progn
(progn
(set '--cl-G79813-- #'(lambda nil BAR-BODY))
(set '--cl-G79812-- #'(lambda nil FOO-BODY)))
(funcall (symbol-value '--cl-G79812--))
(funcall (symbol-value '--cl-G79813--))))
Previous Message by Thread:
click to view message preview
Re: bogus change(s) in cl-macs.el
> Well, actually we can't see it here because you haven't used print-gensym
> to distinguish symbols with the same name. But indeed:
> (labels ((foo nil 1) (bar nil 2)) (cons (foo) (bar)))
> returns (1 . 1). This is because cl's macro environment uses symbol names
> rather than symbols for symbol-macros, so if two symbols have the same name
> (i.e. `eq', not just `equal') and they both are symbol-macros, then
> CL screws up. I'm working on a patch for that.
OK, I've committed basically your fix (except it also needed to be applied
at one other place, and I added some comment explaining why we use `gensym'
rather than `make-symbol' there).
Stefan
Next Message by Thread:
click to view message preview
[emacs-w3m:07195] antenna supports RSS
RSS で更新が告知されているサイトを,antenna で補足できるようにしてみま
した.
・w3m-rss.el と sb-rss.el でかなりコードが重複してしまっているので整
理が必要.
・最初のチャンネルの更新日時だけを使っているので,チャンネルの更新日
時が指定されていない場合はうまく動かない.
などの問題があります.
とりあえずの叩き台ですので,適当に改良して頂けるとありがたいです.
--
土屋 雅稔 ( TSUCHIYA Masatoshi )