how can I bind the matched :or or to a variable in core.match?
user=> (use 'clojure.core.match)
user=> (let [v 2]
#_=> (match [v]
#_=> [((:or 1 2) :as x)] [:foo x]
#_=> :else :bar))
java.lang.RuntimeException: Unable to resolve symbol: x in this context
clojure.lang.Compiler$CompilerException: java.lang.RuntimeException: Unable to resolve symbol: x in this context, compiling:(/private/var/folders/jp/y5hpfwq962x476pm_1knzr8c0000gn/T/form-init7072120633012300984.clj:2:10)
user=>
Seems that
core.matchdoesn't allow:orpatterns to be bound to symbol. But you always can emulate:orbehavior with guards and guarded patterns can be bound to symbol: