From e4459f4802e8b222eec55196d44c25dc7a5bc53b Mon Sep 17 00:00:00 2001 From: Hilton Chain Date: Mon, 5 May 2025 19:27:17 +0800 Subject: utils: with-transformation: Deprioritize matching of procedures. * nonguix/utils.scm (with-transformation): Deprioritize procedure matching. --- nonguix/utils.scm | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/nonguix/utils.scm b/nonguix/utils.scm index 4680557..1bd0839 100644 --- a/nonguix/utils.scm +++ b/nonguix/utils.scm @@ -64,17 +64,6 @@ matches PRED." (match obj ((? pred) (proc obj)) - ;; TODO: Check if this can be handled as well. - ((? parameter?) - obj) - ((? procedure?) - (lambda args - (apply values - (map (cut with-transformation proc <> pred) - (call-with-values - (lambda () - (apply obj args)) - list))))) ((a . b) (cons (with-transformation proc a pred) (with-transformation proc b pred))) @@ -109,6 +98,17 @@ matches PRED." (obj (accessor obj))) (with-transformation proc obj pred))) record-fields)))))) + ;; TODO: Check if this can be handled as well. + ((? parameter?) + obj) + ((? procedure?) + (lambda args + (apply values + (map (cut with-transformation proc <> pred) + (call-with-values + (lambda () + (apply obj args)) + list))))) (_ obj))) (define (package-with-alias alias pkg) -- cgit v1.2.3