This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-09-15
Channels
- # announcements (71)
- # architecture (2)
- # aws (41)
- # babashka (23)
- # beginners (80)
- # calva (26)
- # chlorine-clover (11)
- # cljfx (4)
- # cljs-dev (12)
- # clojure (78)
- # clojure-berlin (5)
- # clojure-czech (3)
- # clojure-dev (9)
- # clojure-europe (45)
- # clojure-france (16)
- # clojure-gamedev (2)
- # clojure-italy (3)
- # clojure-nl (4)
- # clojure-spec (8)
- # clojure-sweden (1)
- # clojure-uk (37)
- # clojurescript (18)
- # community-development (15)
- # conjure (30)
- # cursive (51)
- # datomic (16)
- # duct (19)
- # figwheel-main (3)
- # fulcro (23)
- # java (7)
- # jobs (2)
- # joker (10)
- # off-topic (7)
- # parinfer (1)
- # pathom (6)
- # reagent (5)
- # reitit (1)
- # remote-jobs (1)
- # sci (1)
- # shadow-cljs (55)
- # slack-help (3)
- # specter (4)
- # sql (21)
- # tools-deps (11)
- # vim (5)
- # xtdb (14)
@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 @U446AB17F! =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)