@tvalerio See the following under the Literals
section at https://clojure.org/reference/reader
> A keyword that begins with two colons is auto-resolved in the current namespace to a qualified keyword
So when you use ::rates
inside rates.clj
it’s as if you’ve written :develop.rates/rates
but when you do the same inside rates-test.clj
you get develop.rates-test/rates
and not :develop.rates/rates
Ok, I understood. Thanks @anthony-galea! =D
It seems the conformed result of the pred passed to s/coll-of is getting disregarded. Is this behavior of expected?
(s/conform
(s/and (s/tuple #{"a"} boolean?)
(s/conformer (fn [[_ v]] [:a v])))
["a" true])
=> [:a true]
(s/conform
(s/coll-of
(s/and (s/tuple #{"a"} boolean?)
(s/conformer (fn [[_ v]] [:a v])))
:kind map?)
{"a" true})
=> {"a" true}
(the API URL was incorrect)
@kenny I think because you are using :kind map?
you're into the map-specific conforming logic which (by default) does not conform keys
You can use :conform-keys to change that default:
(s/conform
(s/coll-of
(s/and (s/tuple #{"a"} boolean?)
(s/conformer (fn [[_ v]] [:a v])))
:kind map?
:conform-keys true)
{"a" true})
{:a true}
(that's a more useful URL, sorry for the noise)
Great, that works perfect. Thank you!