Skip to content

Instantly share code, notes, and snippets.

@senior
Created February 8, 2011 23:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save senior/817497 to your computer and use it in GitHub Desktop.
Save senior/817497 to your computer and use it in GitHub Desktop.
Macro/AOT Issue
(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