This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-01-28
Channels
- # announcements (4)
- # aws (2)
- # babashka (56)
- # beginners (43)
- # calva (70)
- # clj-kondo (25)
- # cljs-dev (29)
- # clojure (103)
- # clojure-dev (9)
- # clojure-europe (55)
- # clojure-gamedev (8)
- # clojure-nl (5)
- # clojure-norway (5)
- # clojure-uk (4)
- # clojured (1)
- # clojurescript (56)
- # copenhagen-clojurians (1)
- # core-async (2)
- # cursive (16)
- # datomic (5)
- # deps-new (18)
- # emacs (9)
- # events (3)
- # fulcro (45)
- # graphql (2)
- # gratitude (2)
- # kaocha (6)
- # lambdaisland (8)
- # lsp (72)
- # meander (41)
- # missionary (5)
- # nextjournal (52)
- # off-topic (2)
- # pathom (12)
- # pedestal (2)
- # practicalli (1)
- # re-frame (6)
- # reitit (5)
- # releases (1)
- # reveal (1)
- # specter (3)
- # sql (4)
- # tools-deps (22)
- # vim (8)
- # wasm (1)
- # xtdb (22)
Is there a reason to prefer (not (nil? ...
) over (some? ...)
here? https://github.com/clojure/clojure/compare/clojure-1.10.3...clojure-1.11.0-alpha4#diff-6ec76ff2fe0601cd5e970e5d947befdcc6cb68da20e5d945a6a520c21f0ab2b5R136
That link doesn't seem to produce anything useful @jumar - what was it supposed to show?
I suspect that code predates Clojure 1.6?
some?
is defined to be not nil?
but the latter was the only way to say that in Clojure 1.5 and earlier.
Oh, it's new code. And you're wondering why it doesn't use some?
@jumar?
Probably because (not (nil? x))
had been idiomatic for years and the person writing the code just happened to write it that way? I doubt there's any significance to it. It could be some?
yes. Which would compile to the exact same code.
So I guess the answer is "No, no reason, and the code is identical so it doesn't matter"...