matcher-project/set, matcher-project/set/single
This commit is contained in:
parent
0a509dce1b
commit
1c88d86472
|
@ -40,6 +40,8 @@
|
||||||
matcher-project
|
matcher-project
|
||||||
matcher-key-set
|
matcher-key-set
|
||||||
matcher-key-set/single
|
matcher-key-set/single
|
||||||
|
matcher-project/set
|
||||||
|
matcher-project/set/single
|
||||||
|
|
||||||
;; Printing and Serialization
|
;; Printing and Serialization
|
||||||
pretty-print-matcher
|
pretty-print-matcher
|
||||||
|
@ -764,6 +766,14 @@
|
||||||
(define vss (matcher-key-set m))
|
(define vss (matcher-key-set m))
|
||||||
(and vss (for/set [(vs (in-set vss))] (car vs))))
|
(and vss (for/set [(vs (in-set vss))] (car vs))))
|
||||||
|
|
||||||
|
;; Convenience forms for the common operation of projecting a Matcher
|
||||||
|
;; followed by converting the result to a Racket set (possibly
|
||||||
|
;; containing just the first captured subvalue).
|
||||||
|
(define-syntax-rule (matcher-project/set arg ...)
|
||||||
|
(matcher-key-set (matcher-project arg ...)))
|
||||||
|
(define-syntax-rule (matcher-project/set/single arg ...)
|
||||||
|
(matcher-key-set/single (matcher-project arg ...)))
|
||||||
|
|
||||||
;; struct-type -> Symbol
|
;; struct-type -> Symbol
|
||||||
;; Extract just the name of the given struct-type.
|
;; Extract just the name of the given struct-type.
|
||||||
(define (struct-type-name st)
|
(define (struct-type-name st)
|
||||||
|
|
Loading…
Reference in New Issue