about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ravanan/work/utils.scm6
1 files changed, 6 insertions, 0 deletions
diff --git a/ravanan/work/utils.scm b/ravanan/work/utils.scm
index 51da34c..1323352 100644
--- a/ravanan/work/utils.scm
+++ b/ravanan/work/utils.scm
@@ -24,6 +24,7 @@
   #:use-module (ice-9 match)
   #:use-module (ice-9 popen)
   #:export (list->dotted-list
+            alist=?
             assoc-ref*
             assoc-set
             call-with-temporary-directory
@@ -37,6 +38,11 @@ pairs."
           (cons key value)))
        lst))
 
+(define (alist=? alist1 alist2)
+  "Return @code{#t} if @var{alist1} and @var{alist2} are equal. Keys and values are
+compared using @code{equal?}, and the order of key-value pairs does not matter."
+  (lset= equal? alist1 alist2))
+
 (define (assoc-ref* alist key)
   "Return value mapped to @var{key} in @var{alist}. Raise an &assertion
 if not found."