emacs-devel
[Top][All Lists]
Advanced

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

Re: Using empty_string as the only "" string


From: Miles Bader
Subject: Re: Using empty_string as the only "" string
Date: Wed, 25 Apr 2007 10:47:59 +0900

address@hidden (Johan Bockgård) writes:
>> I disagree.  I don't think most people expect much one way or the other
>> in this case, _especially_ because we're talking about lexical constants
>> (for instance, I expect very few people would be surprised if the
>> compiler merged various lexical constants).
>
> How about this then?
>
>         (let ((s1 (concat "ab" "c"))
>               (s2 (concat "a" "bc")))
>           (eq s1 s2)))))
..
> ** Prevent byte compiler from causing spurious string sharing
> when it optimizes away calls to functions such as concat.

S1 and S2 are not lexical constants -- and more importantly, the
`concat' function makes a specific guarantee that it will always return
a new string.

-Miles

-- 
`There are more things in heaven and earth, Horatio,
 Than are dreamt of in your philosophy.'





reply via email to

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