我正尝试执行一个规范,它是两个其它规范的联合,并带有选择
(ns example
(:require [clojure.alpha.spec :as s]))
(s/def ::val1 int?)
(s/def ::foo (s/schema [::val1]))
(s/def ::val2 int?)
(s/def ::bar (s/schema [::val2]))
(s/def ::foobar (s/union ::foo ::bar))
(s/exercise (s/select ::foobar [::val1]))
但这样会抛出错误。
没有实现方法:协议中的:keysps*
n'clojure.alpha.spec.protocols/Schema未找到类
clojure.alpha.spec.impl$union_impl$reify__7091
选择应该适用于这种情况吗?或者我是否做错了什么?
我在使用
org.clojure/alpha.spec {:git/url "https://github.com/clojure/spec-alpha2.git"
:sha "495e5ac3238be002b4de72d1c48479f6bec06bb3"}