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: Stefan Monnier
Subject: Re: Pushing the `gnus-range-*' functions down into the C layer
Date: Sun, 12 Sep 2010 11:57:12 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

>> #define EQ(x, y) (XHASH (x) == XHASH (y))

Not only that, but also

   #define NILP(x)  EQ (x, Qnil)

So EQ is really used extensively in C and slowing it down is likely to
make a perceptible difference.   

>> /* Return a perfect hash of the Lisp_Object representation.  */
>> #define XHASH(a) (a)

> 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.

Nothing says that hashing an object should behave like deep copying.
That's why make-hash-table has a :test parameter which can be `eq' or
`equal'.
As for why we have XHASH: because there's another definition of it for
when we use a union rather than an int for Lisp_Object:

    #define XHASH(a) ((a).i)

    
-- Stefan



reply via email to

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