ref: 0e24bab6a96841fd3d8752ef0d8916f7659d355e
parent: 4c7f40659c29208f37c51acc35d4b1887d8e0f64
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Tue Jun 25 00:21:05 EDT 2024
remove duplicate extra context fields
--- a/gen.rkt
+++ b/gen.rkt
@@ -35,11 +35,10 @@
(-> symbol? boolean?)
(regexp-match? #rx"^[A-Z][A-Z0-9_]+$" (symbol->string e)))
-(define/contract (format f)
- (-> procedure? string?)
+(define (format f #:on-all [allfun identity])
(define-values (a b) (partition c-typedef? (flatten (map f cmplxs))))
(define ps (list a b (map f types) ""))
- (string-join (flatten ps) "\n"))
+ (string-join (allfun (flatten ps)) "\n"))
(define (fmt-expr e)
(define (fmt e)
@@ -611,7 +610,7 @@
EOF
)
- (printf (format extra-context-fields))
+ (printf (format extra-context-fields #:on-all remove-duplicates))
(printf #<<EOF
};