示例
user=> (require '[clojure.core.match :as m]) nil user=> (m/match [[1 2 3]] [(x :<< first)] x) IllegalArgumentException No method in multimethod 'to-source' for dispatch value: null clojure.lang.MultiFn.getFn (MultiFn.java:156)
似乎可以通过为通配符添加 dummy to-source 来修复此问题
`
user=> (defmethod m/to-source nil [pattern ocr]
(if (m/wildcard-pattern? pattern)
true
(throw (AssertionError. (str "Don't know how to emit code for: " pattern)))))
object[clojure.lang.MultiFn 0x4bb9f7d4 "clojure.lang.MultiFn@4bb9f7d4"]
user=> (m/match [[1 2 3]] [(x :<< first)] x)<br> 1
`