diff --git a/prospect/route.rkt b/prospect/route.rkt index e86cf17..6b32ba0 100644 --- a/prospect/route.rkt +++ b/prospect/route.rkt @@ -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)