From 0f176342245b5d1827d5dc1181d310c4bbc832c9 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sat, 2 Apr 2022 14:48:38 -0700 Subject: replace uses of COLLAPSE-TYPES & drop the function Signed-off-by: Sean Whitton --- src/combinator.lisp | 11 +++++------ src/package.lisp | 2 +- src/property.lisp | 2 -- src/property/os.lisp | 3 +-- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/combinator.lisp b/src/combinator.lisp index c1a76a6..9a92362 100644 --- a/src/combinator.lisp +++ b/src/combinator.lisp @@ -98,7 +98,7 @@ Usage notes: ,@forms))))) (define-function-property-combinator eseqprops (&rest propapps) - (:retprop :type (collapse-types (mapcar #'propapptype propapps)) + (:retprop :type (combine-propapp-types propapps) :hostattrs (lambda () (mapc #'propappattrs propapps)) :apply (lambda () (apply-and-print propapps)) :unapply (lambda () (apply-and-print propapps t)))) @@ -106,7 +106,7 @@ Usage notes: (define-function-property-combinator eseqprops-until (condition &rest propapps) "Like ESEQPROPS, but if CONDITION is signalled, handle it simply by skipping remaining elements of PROPAPPS. CONDITION must subtype FAILED-CHANGE." - (:retprop :type (collapse-types (mapcar #'propapptype propapps)) + (:retprop :type (combine-propapp-types propapps) :hostattrs (lambda () (mapc #'propappattrs propapps)) :apply (lambda () (with-skip-failed-changes (:condition condition @@ -118,7 +118,7 @@ remaining elements of PROPAPPS. CONDITION must subtype FAILED-CHANGE." (apply-and-print propapps t))))) (define-function-property-combinator seqprops (&rest propapps) - (:retprop :type (collapse-types (mapcar #'propapptype propapps)) + (:retprop :type (combine-propapp-types propapps) :hostattrs (lambda () (mapc #'propappattrs propapps)) :apply (lambda () (with-skip-failed-changes () @@ -134,7 +134,7 @@ apply the elements of REQUIREMENTS in reverse order." `(eseqprops ,@(reverse requirements) ,propapp)) (define-function-property-combinator silent-seqprops (&rest propapps) - (:retprop :type (collapse-types (mapcar #'propapptype propapps)) + (:retprop :type (combine-propapp-types propapps) :hostattrs (lambda () (mapc #'propappattrs propapps)) :apply (lambda () (with-skip-failed-changes () @@ -286,8 +286,7 @@ in order." (define-function-property-combinator on-change* (propapp on-change &optional unapply) (let ((prop (car propapp))) - (:retprop :type - (collapse-types (propapptype propapp) (propapptype on-change)) + (:retprop :type (combine-propapp-types (list propapp on-change)) :desc (get prop 'desc) :hostattrs (lambda (&rest args) (apply #'propattrs prop args) diff --git a/src/package.lisp b/src/package.lisp index f4599f3..5bea0b0 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -191,7 +191,7 @@ #:with-connattrs ;; property.lisp - #:collapse-types + #:combine-propapp-types #:propapptype #:propappargs #:propappdesc diff --git a/src/property.lisp b/src/property.lisp index aca6bbd..23587d6 100644 --- a/src/property.lisp +++ b/src/property.lisp @@ -68,8 +68,6 @@ (getf (cadr propapp) :orig-args) (cdr propapp))) -(defun collapse-types (&rest lists) - (if (member :lisp (flatten lists)) :lisp :posix)) (defun combine-propapp-types (&rest lists) (if (member :lisp (mapcan (curry #'mapcar #'propapptype) lists)) diff --git a/src/property/os.lisp b/src/property/os.lisp index c4da923..65fdc6a 100644 --- a/src/property/os.lisp +++ b/src/property/os.lisp @@ -101,8 +101,7 @@ ;;;; Property combinators (defun typecase-type (cases) - (collapse-types (loop for propapp in (cdr cases) by #'cddr - collect (propapptype propapp)))) + (combine-propapp-types (loop for pa in (cdr cases) by #'cddr collect pa))) (defun typecase-host (host) (class-of (if host -- cgit v1.2.3