This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-05-31
Channels
- # aleph (1)
- # announcements (2)
- # beginners (20)
- # calva (44)
- # cider (60)
- # clj-kondo (6)
- # clojure (27)
- # clojure-dev (2)
- # clojure-europe (8)
- # clojure-italy (18)
- # clojure-mexico (5)
- # clojure-nl (61)
- # clojure-spec (12)
- # clojure-uk (101)
- # clojurescript (82)
- # cursive (2)
- # data-science (21)
- # datomic (24)
- # fulcro (19)
- # graalvm (5)
- # hoplon (11)
- # jobs-discuss (35)
- # juxt (7)
- # keechma (6)
- # off-topic (21)
- # pedestal (5)
- # planck (2)
- # qa (43)
- # re-frame (3)
- # reagent (7)
- # reitit (4)
- # rewrite-clj (12)
- # sql (10)
- # testing (4)
- # tools-deps (6)
- # vim (23)
- # xtdb (3)
The only thing that confuses me is I can't tell if the missing j refers to the :keys vector or to the structure of the map on the right.
And the fact that i is a :i
in the :keys vector is a keyword adds a little confusion for me.
I was hoping the word destructured
would make it clear it was about the :keys
vector
@john you can even put namespaced keywords there, so:
(let [{:keys [:person/name]} {:person/name "Rich"}] name)
or:
(let [{:person/keys [name address]} #:person{:name "Rich" :address "Some city"}] [name address])
["Rich" "Some city"]
@stefan.van.den.oord thanks for the feedback. where is this syntax for CLJS documented? (:require ["react-native-view-overflow" :default ViewOverflow])
It’s from the shadow-cljs user manual: https://shadow-cljs.github.io/docs/UsersGuide.html#_using_npm_packages
Some 3d party modules export their stuff as default
, which is considered old fashioned, but what can you do 😕
let me ask the question another way: how can clj-kondo know that you are using the namespace 🙂
for now you can add this namespace to the ignored namespace using some config: https://github.com/borkdude/clj-kondo/blob/master/doc/config.md#exclude-required-but-unused-namespace-from-being-reported
While you’re at it, you may have a look at the other constructs in that table, e.g. :rename
, if you don’t support that yet…