bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#7145: elisp-code behaves differently after byte-compilation


From: Andreas Schwab
Subject: bug#7145: elisp-code behaves differently after byte-compilation
Date: Sat, 02 Oct 2010 10:54:47 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

"Markus Sauermann" <address@hidden> writes:

> The following code however shows a case where this is not the case.
>
> --- BEGIN CODE ---
> (let ((fun (lambda () (let ((bar "foo")
>                             (baz "foo"))
>                         (eq bar baz)))))
>   (list (funcall (byte-compile fun))
>         (funcall fun)))
> --- END CODE---
>
> Evaluation this code (don't try to byte-compile it, because it is buggy ;-) ) 
> results in:
>
> --- BEGIN OUTPUT ---
> (t nil)
> --- END OUTPUT ---

This is not a bug.  You cannot depend on the uniqueness of literal
strings.  If you want to compare strings you should use equal.

Andreas.

-- 
Andreas Schwab, address@hidden
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."





reply via email to

[Prev in Thread] Current Thread [Next in Thread]