[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Patch: Syntax and Hard Newlines
From: |
Johan Bockgård |
Subject: |
Re: Patch: Syntax and Hard Newlines |
Date: |
Wed, 15 Nov 2006 16:47:28 +0100 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.90 (gnu/linux) |
Stefan Monnier <address@hidden> writes:
> or change byte-opt.el to mark the `propertize' function with
> `byte-optimize-pure-func' rather than with `side-effect-free'.
But then byte-compilation would change the semantics of `propertize'.
-- Function: propertize string &rest properties
This function returns a copy of STRING [...]
^^^^
Actually, that is already the case for (at least) `concat':
(progn
(defun f () (concat "a" "b" "c"))
(aset (f) 0 ?X)
(f))
=> "abc"
(progn
(defun f () (concat "a" "b" "c"))
(byte-compile 'f)
(aset (f) 0 ?X)
(f))
=> "Xbc"
-- Function: concat &rest sequences
This function returns a new string [...]
The `concat' function always constructs a new string that
is not `eq' to any existing string. [...]
While playing with this I found another bug.
This change
revision 2.143
date: 2004-03-12 11:09:59 +0100; author: rms; state: Exp; lines: +3 -2
(byte-compile-get-constant): For strings, do compare text properties.
was made to fix a bug
(http://lists.gnu.org/archive/html/bug-gnu-emacs/2004-03/msg00080.html),
but it accidentally broke constant folding for strings entirely.
It replaced
(assoc ,const byte-compile-constants)
with
(assoc-default ,const byte-compile-constants
'equal-including-properties nil)
However, unlike `assoc' which returns the matching cons,
`assoc-default' returns the cdr. In the code in question it is always
nil.
(assoc-default "foo" '(("foo")) 'equal-including-properties nil)
=> nil
(assoc "foo" '(("foo")))
=> ("foo")
(This should be trivial to fix.)
--
Johan Bockgård
- Re: Patch: Syntax and Hard Newlines, (continued)
- Re: Patch: Syntax and Hard Newlines, Stefan Monnier, 2006/11/14
- Re: Patch: Syntax and Hard Newlines, Herbert Euler, 2006/11/14
- Re: Patch: Syntax and Hard Newlines, Stefan Monnier, 2006/11/14
- Re: Patch: Syntax and Hard Newlines, Herbert Euler, 2006/11/14
- Re: Patch: Syntax and Hard Newlines, Richard Stallman, 2006/11/16
- Re: Patch: Syntax and Hard Newlines, Herbert Euler, 2006/11/30
- Re: Patch: Syntax and Hard Newlines, Stefan Monnier, 2006/11/30
- Re: Patch: Syntax and Hard Newlines, Herbert Euler, 2006/11/14
- Re: Patch: Syntax and Hard Newlines, Miles Bader, 2006/11/15
- Re: Patch: Syntax and Hard Newlines, Stefan Monnier, 2006/11/15
- Re: Patch: Syntax and Hard Newlines,
Johan Bockgård <=
- Re: Patch: Syntax and Hard Newlines, Stefan Monnier, 2006/11/15
- Re: Patch: Syntax and Hard Newlines, Richard Stallman, 2006/11/16
- Re: Patch: Syntax and Hard Newlines, Richard Stallman, 2006/11/16
- Re: Patch: Syntax and Hard Newlines, Johan Bockgård, 2006/11/24
Re: Patch: Syntax and Hard Newlines, Richard Stallman, 2006/11/14
Re: Patch: Syntax and Hard Newlines, Richard Stallman, 2006/11/13
RE: Patch: Syntax and Hard Newlines, Herbert Euler, 2006/11/14