Why doesn't the second example match? cheshire parse-string is giving me an java.lang.Integer and I'm trying to join on some data but it's not matching...
(m/match 1
1 :match
_ :no)
;; => :match
(m/match (Long. 1)
(Long. 1) :match
_ :no)
;; => :no
(type 1)
;; => java.lang.Long
(type (Long. 1))
;; => java.lang.Long
[meander/epsilon "0.0.650"]
Meander is matching that at the symbol level. It is looking for '(Long. 1)
(m/match (Long. 1)
1 :match
_ :no)
;; => :match
(m/match '(Long. 1)
(Long. 1) :match
_ :no)
;; => :match
If you want to just match all numbers, you can do something like thos
(m/match (Long. 1)
(m/pred number? ?x) :match
_ :no)good
(let [n (Integer. 2)]
(m/find [n [{:a (Integer. 1)}
{:a (Integer. 2)}]]
[?n (m/scan (m/and {:a ?n} ?t))] ?t))
bad
(let [n (Integer. 2)]
(m/find [{:a (Integer. 1)}
{:a (Integer. 2)}]
(m/scan (m/and {:a n} ?t)) ?t))
Thanks! Yea, I was thinking that it would have the value there but what you said makes total sense. It's term rewriting!Oh right, unquote. https://github.com/noprompt/meander/blob/epsilon/doc/operator-overview.md#unquote