emacs-devel
[Top][All Lists]
Advanced

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

Re: Pushing the `gnus-range-*' functions down into the C layer


From: Wojciech Meyer
Subject: Re: Pushing the `gnus-range-*' functions down into the C layer
Date: Sat, 11 Sep 2010 17:15:00 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50

Lars Magne Ingebrigtsen <address@hidden> writes:

> "Stephen J. Turnbull" <address@hidden> writes:
>
>> No, for all types.  First you have to check whether something is a
>> bignum, then if not you do a bit-pattern comparison.  Worst case this
>> could double the cost of doing EQ(x,y) in C, and in Lisp `eq' will
>> cost a perceptible amount more.
>
> Right.  Is EQ in C just implemented as a memory check, and absolutely
> nothing else?  It doesn't touch the data at all in any way?
>
> *etag around a bit*
>
> #define EQ(x, y) (XHASH (x) == XHASH (y))
>
> which is
>
> /* Return a perfect hash of the Lisp_Object representation.  */
> #define XHASH(a) (a)
>
> So, yeah, stupid idea.  Never mind.

Yes, because it is physical equivalence, and pointers are unique.  In
this case I agree, it should not be called XHASH because that implies it
is used for structural equivalence, which is misleading. Also, hashing
object should behave like deep copying - follow pointers.

Wojciech



reply via email to

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