GNU bug report logs - #31688
26.1.50; Byte compiler confuses two string variables

Previous Next

Package: emacs;

Reported by: Gemini Lasswell <gazally <at> runbox.com>

Date: Sat, 2 Jun 2018 17:53:01 UTC

Severity: normal

Tags: notabug

Found in version 26.1.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #20 received at 31688 <at> debbugs.gnu.org (full text, mbox):

From: Phil Sainty <psainty <at> orcon.net.nz>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: Gemini Lasswell <gazally <at> runbox.com>,
 bug-gnu-emacs <bug-gnu-emacs-bounces+psainty=orcon.net.nz <at> gnu.org>,
 31688 <at> debbugs.gnu.org
Subject: Re: bug#31688: 26.1.50; Byte compiler confuses two string variables
Date: Sun, 03 Jun 2018 11:38:44 +1200
On 2018-06-03 06:02, Noam Postavsky wrote:
> I don't think this is a bug, the compiler coalesces equal string
> literals.

Ouch.  Has this always been the case?  I've been firmly under the
impression that the lisp reader creates a new lisp objects whenever
it reads a string, so it's hugely surprising to me to learn that
(eq str1 str2) can return different results depending on whether
or not the code was byte-compiled.

I see that this is t when compiled and nil otherwise:

(let ((str1 "abc")
      (str2 "abc"))
  (eq str1 str2)))

But this is nil regardless:

(eq "abc" "abc")

This seems kinda horrible?

-Phil





This bug report was last modified 7 years and 67 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.