unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: "Markus Sauermann" <mhoram@gmx.de>
Cc: 7145@debbugs.gnu.org
Subject: bug#7145: elisp-code behaves differently after byte-compilation
Date: Sat, 02 Oct 2010 10:54:47 +0200	[thread overview]
Message-ID: <m239spotyg.fsf@whitebox.home> (raw)
In-Reply-To: <20101002015349.23590@gmx.net> (Markus Sauermann's message of "Sat, 02 Oct 2010 03:53:49 +0200")

"Markus Sauermann" <mhoram@gmx.de> 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, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."





  reply	other threads:[~2010-10-02  8:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-02  1:53 bug#7145: elisp-code behaves differently after byte-compilation Markus Sauermann
2010-10-02  8:54 ` Andreas Schwab [this message]
2010-10-02 10:41   ` Johan Bockgård
2010-10-03  5:12     ` Chong Yidong
2010-10-05 17:37       ` Markus Sauermann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m239spotyg.fsf@whitebox.home \
    --to=schwab@linux-m68k.org \
    --cc=7145@debbugs.gnu.org \
    --cc=mhoram@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).