[Top][All Lists]

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

Re: How about text-property-functions using `equal' rather than `eq'?

From: David Kastrup
Subject: Re: How about text-property-functions using `equal' rather than `eq'?
Date: Tue, 05 Feb 2008 09:48:38 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux)

Richard Stallman <address@hidden> writes:

>     All the built in text property functions which compare properties appear
>     to use `eq' for the comparison.  Some of these actually say this in
>     their doc-strings or the pertinent manual page, some of them might
>     actually say it in both.  ;-(
> `eq' is faster,

More importantly, it is constant time.

>     I would dearly love to use text-property-any to locate such a
>     buffer position, but unfortunately (eq '(1) '(1)) => nil.  :-( So
>     I've had to code up a clumsy equivalent which will certainly be
>     much slower.
> You can write code which uses the primitives to find the next non-eq
> property, then comparing it with equal and looping so that you find
> the next non-equal property.

One can also see where the constant '(1) is created and keep a copy of
that for eq-comparison.

David Kastrup

reply via email to

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