Function: ht-equal?

ht-equal? is a byte-compiled function defined in ht.el.

Signature

(ht-equal? TABLE1 TABLE2)

Documentation

Return t if TABLE1 and TABLE2 have the same keys and values.

Does not compare equality predicates.

Aliases

ht-equal-p

Source Code

;; Defined in ~/.emacs.d/elpa/ht-20230703.558/ht.el
(defun ht-equal? (table1 table2)
  "Return t if TABLE1 and TABLE2 have the same keys and values.
Does not compare equality predicates."
  (declare (side-effect-free t))
  (let ((keys1 (ht-keys table1))
        (keys2 (ht-keys table2))
        (sentinel (make-symbol "ht-sentinel")))
    (and (equal (length keys1) (length keys2))
         (--all?
          (if (ht-p (ht-get table1 it))
              (ht-equal-p (ht-get table1 it)
                          (ht-get table2 it))
            (equal (ht-get table1 it)
                 (ht-get table2 it sentinel)))
          keys1))))