Fork me on GitHub
#clojure-spec
<
2020-02-07
>
achikin15:02:34

How do I check for exact value?

Alex Miller (Clojure team)15:02:51

#{:foo} is a valid spec

Alex Miller (Clojure team)15:02:58

a set containing one value

achikin15:02:04

Thank you!

achikin15:02:47

As far as I can understand if it’s a boolean I can do (s/def :mykey true?) right?

Alex Miller (Clojure team)16:02:15

prob better to use boolean?

denik16:02:10

I'm trying to get the spec (or any spec) from cljs.core.specs.alpha but

(ns my-ns
  (:require [clojure.spec.alpha :as s]
            [cljs.core.specs.alpha :as cljs-specs]))

(s/form ::cljs-specs/local-name)
throws
Error: Unable to resolve spec: :cljs.core.specs.alpha/local-name
Why this is happening? the spec is defined: https://github.com/clojure/clojurescript/blob/ef32778989f7ba2311a1e8a5d99c30e6805f5719/src/main/cljs/cljs/core/specs/alpha.cljc#L16