; Pattern Matching ; ================ (module matching mzscheme (provide match?-lambda) (require (lib "match.ss")) ; Factory for True/False Matchers ; =============================== ; ; (match?-lambda ( ...) ; ...) ; ; Convenient version of match-lambda for producing unary predicates ; that simply test whether the argument matches one of the patterns, ; though result processing is still available. ; ; Omitted result expressions default to #t, and non-match defaults to #f. ; (define-syntax match?-lambda (syntax-rules () ((_ ( ...) ...) (match-lambda ( #t ...) ... (_ #f))))) )