This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-07-26
Channels
- # bangalore-clj (1)
- # beginners (12)
- # boot (48)
- # cider (56)
- # clara (1)
- # cljs-dev (15)
- # clojure (455)
- # clojure-austin (2)
- # clojure-dev (33)
- # clojure-italy (26)
- # clojure-nl (6)
- # clojure-poland (10)
- # clojure-russia (23)
- # clojure-spec (33)
- # clojure-uk (62)
- # clojurescript (37)
- # code-art (2)
- # cursive (12)
- # datomic (48)
- # funcool (1)
- # juxt (16)
- # leiningen (13)
- # off-topic (12)
- # om (23)
- # onyx (16)
- # other-lisps (5)
- # parinfer (2)
- # pedestal (28)
- # re-frame (60)
- # reagent (8)
- # ring (1)
- # ring-swagger (15)
- # spacemacs (5)
- # specter (53)
- # test-check (2)
- # unrepl (8)
- # vim (14)
video will hopefully be out by next week, but I don’t really have any control over that
@dpsutton The copyright on each contrib depends on who wrote the code -- and the CA co-assigns copyright to Rich.
For example https://github.com/clojure/java.jdbc#copyright-and-license is me and Stephen Gilardi (and under the CA Rich has co-rights, although they're not called out there directly) @dpsutton
just noticed this while refactoring some code, is it just me or does that seem wrong?
Interesting, I guess the destructuring is performed after the method call, so it will shadow the actual param.
yeah, that expands to something like (defn foo [map__1 foo] (let [foo (get map__1 :foo) ..))
a warning would be nice, took me 30min to figure out why the heck I was getting nil where I clearly wasn’t passing nil
@cfleming maybe a fix in cursive since it technically highlights the incorrect foo
😉
Seems like that would be fairly easy to catch with spec at some point.
Doesn't seem like a good check for spec
It's also something occasionally done intentionally with _ args
So I would say it's garbage in, semantically consistent values out
I seem to recall warnings from eastwood about locals shadowing namespace level or clojure.core values, but intentional shadowing is common enough in local scope that I think the warnings would give you a lot of false positives.
sure, but in this exact situation it isn't just locals shadowing, it is args shadowing each other, which I think outside of _
is extremely rare and pretty much always unintentional, so seems like a good candidate for linter. the linter would have to check before macro expansion so it would need to understand destructuring
not always
I mean, I think you’re probably right 99% of the time but people do a lot of weird stuff
@thheller I don't think Eastwood warns about that case today, but I've created an issue with your example to remind us of the usefulness of such a warning.