aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob L. Kreuze2023-05-03 10:46:34 -0400
committerJakob L. Kreuze2023-05-03 10:46:34 -0400
commit62440c0d5b99ee925045158d22a69f51607ab601 (patch)
tree6d53c7220dd01e7ca043f98c4b037fc61eab043f
parent725d02db071b79ab9007fdd9c38656b3eedd8edf (diff)
Fix issue of policy-map dropping rules
-rw-r--r--compiler/types.scm10
1 files changed, 6 insertions, 4 deletions
diff --git a/compiler/types.scm b/compiler/types.scm
index 83ae370..d3ee3dc 100644
--- a/compiler/types.scm
+++ b/compiler/types.scm
@@ -78,10 +78,12 @@
(define (policy-map policy f)
(over (ι-policy-rules)
- (lambda (rules)
- (zip (map car rules)
- ;; n.b. discards `scope', `breadcrumb'
- (map (compose (cut tree-map <> f (scope policy) '()) cadr) rules)))
+ (lambda (rule-groups)
+ (map (match-lambda
+ ((group-head rules ...)
+ `(,group-head
+ ,@(map (compose (cut tree-map <> f (scope policy) '())) rules))))
+ rule-groups))
policy))
(define-method (tree-map form f scope breadcrumb)

© 2015 - 2026 Jakob L. Kreuze