diff options
-rw-r--r-- | module/util.scm | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/module/util.scm b/module/util.scm index 54a57a2c..6d8aeaf7 100644 --- a/module/util.scm +++ b/module/util.scm @@ -369,6 +369,14 @@ (resolve-interface '(mod ...))) ...)))) +;; Merges two association lists, comparing with eq. +;; The cdrs in all pairs in both lists should be lists, +;; If a key is present in both then the contents of b is +;; put @emph{before} the contents in a. +;; @example +;; (assq-merge '((k 1)) '((k 2))) +;; => ((k 2 1)) +;; @end example (define-public (assq-merge a b) (fold (lambda (entry alist) (let* (((k . v) entry) |