diff options
author | Hilton Chain <hako@ultrarare.space> | 2025-05-05 19:27:17 +0800 |
---|---|---|
committer | Hilton Chain <hako@ultrarare.space> | 2025-05-14 16:03:30 +0800 |
commit | e4459f4802e8b222eec55196d44c25dc7a5bc53b (patch) | |
tree | 78f76c04694caa29685f8610f9140403009e1e0f | |
parent | 5f3ad33833a04e4e5d27405c20f2a85f241a59ba (diff) |
utils: with-transformation: Deprioritize matching of procedures.
* nonguix/utils.scm (with-transformation): Deprioritize procedure matching.
-rw-r--r-- | nonguix/utils.scm | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/nonguix/utils.scm b/nonguix/utils.scm index 46805570..1bd08390 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) |