Created
January 12, 2018 18:20
-
-
Save ruliana/484a4ee0b1c4e2e3084319eec84c737a to your computer and use it in GitHub Desktop.
A macro that generates a new pattern for pattern matching
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define-syntax-rule (define-pattern (name args ...) substitution) | |
(define-match-expander name | |
(syntax-rules () | |
[(_ args ...) substitution]))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment