emacs-devel
[Top][All Lists]
Advanced

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

Re: Consider adding hash-keys and hash-values


From: Bozhidar Batsov
Subject: Re: Consider adding hash-keys and hash-values
Date: Wed, 30 Oct 2013 11:36:24 +0200

Any comments for or against the proposal? Should I could consider your silence a sign of consent and submit a patch?


On 24 October 2013 17:16, Bozhidar Batsov <address@hidden> wrote:
Hi everyone,

I’ve seen the following functions (or their equivalents) inlined in many packages:

(defun hash-keys (hashtable)
  "Return a list of keys in HASHTABLE."
  (let ((keys '()))
    (maphash (lambda (k v) (setq keys (cons k keys))) hashtable)
    keys))

(defun hash-values (hashtable)
  "Return a list of values in HASHTABLE."
  (let ((values '()))
    (maphash (lambda (k v) (setq keys (cons k values))) hashtable)
    keys))

Is there any particular reason why we don’t have them as part of the standard set of hash functions? They are pretty useful and just about every programming language has them in its standard library.

-- 
Cheers,
Bozhidar



reply via email to

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