From 8fb311a8f66eacfd25873f47d53ed4dd547bd1e1 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Thu, 19 Sep 2024 21:42:07 +0100 Subject: work/utils: Add alist=?. * ravanan/work/utils.scm (alist=?): New public function. --- ravanan/work/utils.scm | 6 ++++++ 1 file changed, 6 insertions(+) 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." -- cgit v1.2.3