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 4680557..1bd0839 100644 --- a/nonguix/utils.scm +++ b/nonguix/utils.scm | |||
| @@ -64,17 +64,6 @@ matches PRED." | |||
| 64 | (match obj | 64 | (match obj |
| 65 | ((? pred) | 65 | ((? pred) |
| 66 | (proc obj)) | 66 | (proc obj)) |
| 67 | ;; TODO: Check if this can be handled as well. | ||
| 68 | ((? parameter?) | ||
| 69 | obj) | ||
| 70 | ((? procedure?) | ||
| 71 | (lambda args | ||
| 72 | (apply values | ||
| 73 | (map (cut with-transformation proc <> pred) | ||
| 74 | (call-with-values | ||
| 75 | (lambda () | ||
| 76 | (apply obj args)) | ||
| 77 | list))))) | ||
| 78 | ((a . b) | 67 | ((a . b) |
| 79 | (cons (with-transformation proc a pred) | 68 | (cons (with-transformation proc a pred) |
| 80 | (with-transformation proc b pred))) | 69 | (with-transformation proc b pred))) |
| @@ -109,6 +98,17 @@ matches PRED." | |||
| 109 | (obj (accessor obj))) | 98 | (obj (accessor obj))) |
| 110 | (with-transformation proc obj pred))) | 99 | (with-transformation proc obj pred))) |
| 111 | record-fields)))))) | 100 | record-fields)))))) |
| 101 | ;; TODO: Check if this can be handled as well. | ||
| 102 | ((? parameter?) | ||
| 103 | obj) | ||
| 104 | ((? procedure?) | ||
| 105 | (lambda args | ||
| 106 | (apply values | ||
| 107 | (map (cut with-transformation proc <> pred) | ||
| 108 | (call-with-values | ||
| 109 | (lambda () | ||
| 110 | (apply obj args)) | ||
| 111 | list))))) | ||
| 112 | (_ obj))) | 112 | (_ obj))) |
| 113 | 113 | ||
| 114 | (define (package-with-alias alias pkg) | 114 | (define (package-with-alias alias pkg) |
