Created
February 8, 2011 23:07
-
-
Save senior/817497 to your computer and use it in GitHub Desktop.
Macro/AOT Issue
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
(defmacro match-record | |
([matches expr] | |
`(match-record ~matches ~expr nil)) | |
([[record in] expr fail-expr] | |
(println "Multimethods "(methods record-matcher) " class " (class record)) | |
(println "Record matcher " (record-matcher record) " class record " (class record)) | |
`(if-match [~(record-matcher record) ~in] ~expr ~fail-expr))) | |
(match-record [(new-baz {:bar ?e} ) nil] | |
(some #(match-record [(new-baz {:bar false}) %] true) e)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment