Good morning
God morgen!
good morning!
Bonne journée à tous !
Good morning!
Morning
lost half an hour of my life on this:
(defn foo [{:keys [bar :as lol]}] lol)
I'm sure clj-kondo would have caught it in one way or another.
yup ;)
I posted a question on http://ask.clojure.org about this, since I do think this is nonsensical and could/should be caught by a destructuring-spec.
morning!
@slipset It's not nonsensical. you can use keywords in destructuring (most useful when using namespaced keywords) and treating :as
as special would be surprising
Right,
(let [{:keys [:as]} {:as 'foo}] as)
I can see how this would be useful (and I have used it) with namespaced kws, but it's a bit more far fetched with non-namespaced kws.
That ship has also long sailed, it's been there for a long time and won't be changed.
It's a linter 🙂
Some people even prefer it over symbols, as it's easier to grep for keywords
Don't use non-namespaced keywords in :keys destructuring 🙂
We use it in our codebase at work almost everywhere
It can definitely be an optional linter
but it's very much a taste / preference thing
maybe mixed style in one destructuring can be seen as bad
but clj-kondo already catches this sillyness by reporting :as
as an unused binding, so I think it's sufficiently covered
true.
Well, I learned a couple of things, amongst them, a function called ident?
which was added in 1.9
morning
morning
👋
morning