emacs-devel
[Top][All Lists]
Advanced

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

RFC: make maphash return a list


From: Wilfred Hughes
Subject: RFC: make maphash return a list
Date: Fri, 3 May 2013 18:59:10 +0100

I've been using Emacs hash tables a lot recently, and I would find
several operations much easier if maphash returned a list. For
example, I'd like to be able to do:

(maphash (lambda (key value) key) some-table)

to obtain the list of keys present in some-table. I would guess elisp
is influenced by Common Lisp here, where maphash returns nil
unconditionally. However, unlike elisp, Common Lisp's loop macro
supports iterating over keys directly with (loop for key being
hash-key of some-table ...) which helps considerably.

I can't see any obvious way this would break backwards compatibility,
so I threw together a trivial patch that makes maphash return a list
of the results. I've attached the patch.

Is there interest in this?

Wilfred

Attachment: fns.c.diff
Description: Text Data


reply via email to

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