From f21a4451de5c5e99f7ec00b57687869def1918f0 Mon Sep 17 00:00:00 2001 From: "Scott L. Burson" Date: Thu, 30 May 2024 21:28:55 -0700 Subject: [PATCH] There were a few more 'gmap' forms in the old syntax. --- Code/relations.lisp | 31 ++++++++++++++++--------------- Code/testing.lisp | 8 ++++---- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/Code/relations.lisp b/Code/relations.lisp index 008f493..368bcff 100644 --- a/Code/relations.lisp +++ b/Code/relations.lisp @@ -295,13 +295,14 @@ constructed." (defun 2-relation-fn-compose (rel fn) (let ((new-size 0) - ((new-map0 (gmap :wb-map (lambda (x ys) - (let ((result nil)) - (Do-WB-Set-Tree-Members (y ys) - (setq result (WB-Set-Tree-With result (@ fn y)))) - (incf new-size (WB-Set-Tree-Size result)) - (values x result))) - (:wb-map (make-wb-map (wb-2-relation-map0 rel))))))) + ((new-map0 (gmap (:result wb-map) + (fn (x ys) + (let ((result nil)) + (Do-WB-Set-Tree-Members (y ys) + (setq result (WB-Set-Tree-With result (@ fn y)))) + (incf new-size (WB-Set-Tree-Size result)) + (values x result))) + (:arg wb-map (make-wb-map (wb-2-relation-map0 rel))))))) (make-wb-2-relation new-size (wb-map-contents new-map0) nil))) @@ -637,22 +638,22 @@ contains the pairs <1, a>, <1, b>, <2, a>, and <2, b>." (recur (cdr subforms) `(union ,result (let ((,vals-var ,(cadadr subform))) - (gmap :union + (gmap (:result union) (fn (,key-var) (convert ',type-name (map (,key-var ,vals-var)) :from-type 'map-to-sets)) - (:set ,(cadar subform)))))))) + (:arg set ,(cadar subform)))))))) ((and (listp (car subform)) (eq (caar subform) '$)) (let ((key-var (gensym "KEY-")) (val-var (gensym "VAL-"))) (recur (cdr subforms) `(union ,result (let ((,val-var ,(cadr subform))) - (gmap :union + (gmap (:result union) (fn (,key-var) (,type-name (,key-var ,val-var))) - (:set ,(cadar subform)))))))) + (:arg set ,(cadar subform)))))))) ((and (listp (cadr subform)) (eq (caadr subform) '$)) (recur (cdr subforms) `(union ,result @@ -799,9 +800,9 @@ pattern.")) (gmap (:result list :filterp #'identity) (fn (index i pat-elt) (and (logbitp i mask) - (gmap :union + (gmap (:result union) (fn (pat-elt-elt) (@ index (list pat-elt-elt))) - (:set pat-elt)))) + (:arg set pat-elt)))) (:arg list (get-indices rel mask)) (:arg index 0) (:arg list pattern)))) @@ -863,8 +864,8 @@ considered as a bit set." (:arg list unindexed) (:arg index 0)) (setf (wb-list-relation-indices rel) indices)) - (gmap :list (lambda (ex-ind new-index) - (or ex-ind new-index)) + (gmap (:result list) (fn (ex-ind new-index) + (or ex-ind new-index)) (:list ex-inds) (:vector new-indices)))))) diff --git a/Code/testing.lisp b/Code/testing.lisp index 065ac15..de75c0a 100644 --- a/Code/testing.lisp +++ b/Code/testing.lisp @@ -287,14 +287,14 @@ (test (equal (multiple-value-list (lookup (convert 'bag '(3 3 5 5 5)) 4)) '(nil nil))) (dolist (n '(2 5 10 20)) - (let* ((s (gmap :set (fn (i) (make-instance 'my-unhandled-obj :value i)) (:index 0 n))) - (singles (gmap :list (fn (o) (set o)) (:set s)))) + (let* ((s (gmap (:result set) (fn (i) (make-instance 'my-unhandled-obj :value i)) (:arg index 0 n))) + (singles (gmap (:result list) (fn (o) (set o)) (:arg set s)))) (dolist (s1 singles) (test (subset? s1 s)) (test (not (subset? s s1)))) (test (every (lambda (o) (lookup s o)) s)))) - (let* ((objs (gmap :list (fn (i) (make-instance 'my-unhandled-obj :value i)) (:index 0 3))) + (let* ((objs (gmap (:result list) (fn (i) (make-instance 'my-unhandled-obj :value i)) (:arg index 0 3))) (s (convert 'set objs)) (s1 (set (car objs))) (s2 (set (cadr objs))) @@ -387,7 +387,7 @@ (simple-type-error (e) e))) (dolist (n '(0 2 5 7 10)) - (let* ((vals (gmap :list nil (:index 0 n))) + (let* ((vals (gmap (:result list) nil (:arg index 0 n))) #+sbcl (seq (make-instance 'my-sequence :actual vals)) (s (set)))