Function: ht-select

ht-select is a byte-compiled function defined in ht.el.

Signature

(ht-select FUNCTION TABLE)

Documentation

Return a hash table containing all entries in TABLE for which FUNCTION returns a truthy value.

FUNCTION is called with two arguments, KEY and VALUE.

Source Code

;; Defined in ~/.emacs.d/elpa/ht-20230703.558/ht.el
(defun ht-select (function table)
  "Return a hash table containing all entries in TABLE for which
FUNCTION returns a truthy value.

FUNCTION is called with two arguments, KEY and VALUE."
  (let ((results (ht-create)))
    (ht-each
     (lambda (key value)
       (when (funcall function key value)
         (ht-set! results key value)))
     table)
    results))