Skip to content

Instantly share code, notes, and snippets.

@senior
senior / gist:817497
Created February 8, 2011 23:07
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))
Debugger entered--Lisp error: (wrong-type-argument char-or-string-p nil)
slime-one-line-ify(nil)
slime-insert-xrefs((("(No location)" nil)))
slime-show-xref-buffer((("(No location)" nil)) :calls "function1" "namespace1")
slime-show-xrefs((("(No location)" nil)) :calls "function1" "namespace1")