Would it be worthwhile to have something like this:
(defun hash-table-next (hash-table) "Returns the first EXIST-P, KEY, VALUE triple in the HASH-TABLE it can get its hands on; otherwise, NIL." (with-hash-table-iterator (fn hash-table) (fn)))
?
regards, Samium Gromoff
P.S. The original idea belongs to Tobias Rittweiler.
Samium Gromoff wrote:
Would it be worthwhile to have something like this:
(defun hash-table-next (hash-table) "Returns the first EXIST-P, KEY, VALUE triple in the HASH-TABLE it can get its hands on; otherwise, NIL." (with-hash-table-iterator (fn hash-table) (fn)))
What's the use-case?
Cheers,
-- Nikodemus
Nikodemus Siivola wrote:
Samium Gromoff wrote:
Would it be worthwhile to have something like this:
(defun hash-table-next (hash-table) "Returns the first EXIST-P, KEY, VALUE triple in the HASH-TABLE it can get its hands on; otherwise, NIL." (with-hash-table-iterator (fn hash-table) (fn)))
What's the use-case?
I use something like this, named hash-table-contains-elements-p.
Cheers,
Andreas Fuchs wrote:
Nikodemus Siivola wrote:
Samium Gromoff wrote:
Would it be worthwhile to have something like this:
(defun hash-table-next (hash-table) "Returns the first EXIST-P, KEY, VALUE triple in the HASH-TABLE it can get its hands on; otherwise, NIL." (with-hash-table-iterator (fn hash-table) (fn)))
What's the use-case?
I use something like this, named hash-table-contains-elements-p.
(defun hash-table-empty-p (hash-table) (zerop (hash-table-count hash-table)))
?
Cheers,
-- Nikodemus
Nikodemus Siivola wrote:
Andreas Fuchs wrote:
Nikodemus Siivola wrote:
Samium Gromoff wrote:
Would it be worthwhile to have something like this:
(defun hash-table-next (hash-table)
What's the use-case?
I use something like this, named hash-table-contains-elements-p.
(defun hash-table-empty-p (hash-table) (zerop (hash-table-count hash-table)))
?
Oh, heh. Ooops. Yeah, that will do, too.
Thanks,
At Tue, 10 Jul 2007 11:02:30 +0300, Nikodemus Siivola wrote:
Samium Gromoff wrote:
Would it be worthwhile to have something like this:
(defun hash-table-next (hash-table) "Returns the first EXIST-P, KEY, VALUE triple in the HASH-TABLE it can get its hands on; otherwise, NIL." (with-hash-table-iterator (fn hash-table) (fn)))
What's the use-case?
Picking apart the hash table without:
1. having to know anything about the elements 2. having to do it in a iterative fashion
i.e. "give me an element from that bag".
Cheers,
-- Nikodemus
alexandria-devel@common-lisp.net