diff --git a/js/semantics/Utilities.lisp b/js/semantics/Utilities.lisp index 3a93f69da44..b2871c101ba 100644 --- a/js/semantics/Utilities.lisp +++ b/js/semantics/Utilities.lisp @@ -327,6 +327,15 @@ (write-to-string item))))))) +; Return an association list of all the entries in the hash table. +(defun hash-table-entries (hash-table) + (let ((entries nil)) + (maphash #'(lambda (key value) + (push (cons key value) entries)) + hash-table) + entries)) + + ; Given an association list ((key1 . data1) (key2 . data2) ... (keyn datan)), ; produce another association list whose keys are sets of the keys of the original list, ; where the data elements of each such set are equal according to the given test function. diff --git a/js2/semantics/Utilities.lisp b/js2/semantics/Utilities.lisp index 3a93f69da44..b2871c101ba 100644 --- a/js2/semantics/Utilities.lisp +++ b/js2/semantics/Utilities.lisp @@ -327,6 +327,15 @@ (write-to-string item))))))) +; Return an association list of all the entries in the hash table. +(defun hash-table-entries (hash-table) + (let ((entries nil)) + (maphash #'(lambda (key value) + (push (cons key value) entries)) + hash-table) + entries)) + + ; Given an association list ((key1 . data1) (key2 . data2) ... (keyn datan)), ; produce another association list whose keys are sets of the keys of the original list, ; where the data elements of each such set are equal according to the given test function.