help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Hash tables - how to look up values?


From: Teemu Likonen
Subject: Re: Hash tables - how to look up values?
Date: Wed, 04 Jul 2012 17:09:30 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux)

Thorsten Jolitz [2012-07-04 15:48:09 +0200] wrote:

> that returns the corresponding key of a known (string) value in a hash
> table (similar to 'rassoc' for alists).
>
> I could not find such a function - does it exist already?

There is no such thing. You need to traverse the hash table with maphash
and look for your value. This is obviously slower than gethash but this
is how hash tables work.

If you need fast two-way access in your programs you could create your
own access functions which synchronize two hash tables and thus get fast
two-way access.



reply via email to

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