clojure.spec question

76 views
Skip to first unread message

Philos Kim

unread,
Sep 24, 2016, 10:46:55 AM9/24/16
to Clojure
How can I define the following spec?

{"id" 1 "name" "john"}

1) The keys of a map must be the string type, not the keyword type.

2) The values must be fixed. Namely, the value of the key "id" must be 1 and the value of the key "name" must be "john"    

Alex Miller

unread,
Sep 24, 2016, 12:31:22 PM9/24/16
to Clojure
#{{"id" 1 "name" "john"}} is a valid spec for that
Reply all
Reply to author
Forward
0 new messages