s/def is a macro so it doesn't evaluate the parameter n.
had to use s/def-impl instead like this
(let [n :foo/bar3
f int?]
(s/def-impl n n f)
)
On Tuesday, February 19, 2019 at 1:18:20 PM UTC+1, Sonny To wrote:
>
> (let [n :foo/bar
> f int?]
> (s/def n f)
> )
>
> (s/get-spec :foo/bar)
>
> why does this return nil?
>
> it seems I can only define a spec like this
>
> (s/def :foo/bar int?)
>
> Is there a way to programmatically create a spec from data?
>
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.