matcher-project/set, matcher-project/set/single

This commit is contained in:
Tony Garnock-Jones 2015-03-06 13:24:04 +00:00
parent 0a509dce1b
commit 1c88d86472
1 changed files with 10 additions and 0 deletions

View File

@ -40,6 +40,8 @@
matcher-project
matcher-key-set
matcher-key-set/single
matcher-project/set
matcher-project/set/single
;; Printing and Serialization
pretty-print-matcher
@ -764,6 +766,14 @@
(define vss (matcher-key-set m))
(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
;; Extract just the name of the given struct-type.
(define (struct-type-name st)