除非我弄错了,看起来 & 模式和 :as 模式之间存在一些交互问题
(match (link: [:bar :baz])
(link: ([:bar & r) :as m]) m)
-> (link: :bar)
我期望在这里看到 (link: :bar :baz)
这是我所预期的
(match (link: [:bar :baz])
(link: [:bar & r]) :a)
-> :a
这同样符合预期
(match (link: [:bar :baz])
(link: ([:bar :baz) :as m]) m)
-> (link: :bar :baz)
因此 & 和 :as 都是独立工作的。