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

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

Byte-compilation is over-eager in optimizing string constants


From: Lawrence Mitchell
Subject: Byte-compilation is over-eager in optimizing string constants
Date: Thu, 04 Mar 2004 21:33:15 +0000
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50

(let ((byte-optimize nil))
  (byte-compile
   (lambda ()
     (if x
         "foo"
       #("foo" 0 1 (prop val))))))

=> #[nil "address@hidden        address@hidden" [x "foo"] 1]

Where one might expect it to return:

#[nil "address@hidden   address@hidden" [x "foo" #("foo" 0 1 (prop val) 1 3 
nil)] 1]

The problem is in the call `byte-compile-get-constant', since it
uses `assoc' to test for equality of strings, and

(equal "foo" #("foo" 0 1 (prop val))) => t

I'm not sure if there's a sane way of fixing this, other than
saying "don't do that" as regards constant propertized text
strings.  I suppose one could check for a string being
propertized in the constant test.

In GNU Emacs 21.3.50.24 (i686-pc-linux-gnu, GTK+ Version 2.2.4)
 of 2004-02-14 on yam
configured using `configure '--prefix=/opt/sw/emacs-21.3.5/'
'--with-gtk' '--with-xpm' '--with-jpeg' '--with-tiff'
'--with-gif' '--with-png' '--without-xim' '--without-sound'
'--without-pop' '--with-kerberos' '--with-kerberos5''

[...]

-- 
Lawrence Mitchell <address@hidden>




reply via email to

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