From 1edd618b42821f26b0a31ae63f393c09259c046b Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Fri, 21 Feb 2025 14:05:46 +0000 Subject: Add unit tests for lib.functions.rev-map --- lib/functions.lisp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/functions.lisp') diff --git a/lib/functions.lisp b/lib/functions.lisp index 073e34a..4e18a0a 100644 --- a/lib/functions.lisp +++ b/lib/functions.lisp @@ -37,11 +37,11 @@ each member is STEP distance apart." (subseq lst n))) (fn rev-map (indicator lst &key (key-eq #'eq)) - (-> (function list &key (:key-eq function)) list) + (-> (function sequence &key (:key-eq function)) list) "Given LST and INDICATOR: LST -> A, return an association list A -> 2^LST where key x in A has associations {y in LST : INDICATOR(y) = x}." (loop :with assoc-list := nil - :for element :in lst + :for element :in (coerce lst 'list) :for key := (funcall indicator element) :if (assoc key assoc-list :test key-eq) :do (->> (alist-val key assoc-list) -- cgit v1.2.3-13-gbd6f