emacs-devel
[Top][All Lists]
Advanced

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

RE: [PATCH] Add new function to test whether a key is present in a hash


From: Drew Adams
Subject: RE: [PATCH] Add new function to test whether a key is present in a hash table.
Date: Thu, 15 Feb 2018 18:50:06 -0800 (PST)

> > But isn't it better to define this in C?
> 
> To me the answer is usually no, unless it's speed-critical.

To me too, the answer is usually no.  If this is done
in Lisp it is presumably because it might be useful to
someone to modify or advise, or at least serve as food
for thought.  In that case, the code should be as clear
as possible.

> PS: I think a more interesting function to provide would be some
> gethash-ref which would return some kind of "reference" to the entry, so
> we can afterwards update that hash-table entry without (re)computing the
> hash (i.e. some kind of equivalent to `intern` after which you can just
> do `set` which doesn't involve hashing any more).

Definitely more interesting.

> But that would imply
> a fairly significant amount of design to make it work.



reply via email to

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