This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-07-13
Channels
- # aleph (15)
- # announcements (4)
- # babashka (36)
- # babashka-sci-dev (1)
- # beginners (15)
- # biff (2)
- # calva (15)
- # cider (3)
- # clj-kondo (8)
- # clojure (149)
- # clojure-europe (14)
- # clojure-norway (13)
- # clojure-switzerland (1)
- # clojure-uk (1)
- # clojurescript (21)
- # community-development (5)
- # cursive (20)
- # data-science (2)
- # datomic (7)
- # duct (5)
- # emacs (19)
- # etaoin (3)
- # events (2)
- # fulcro (11)
- # introduce-yourself (2)
- # jobs (4)
- # jobs-discuss (19)
- # joyride (1)
- # leiningen (11)
- # malli (7)
- # membrane (131)
- # nbb (12)
- # nginx (1)
- # off-topic (33)
- # pathom (8)
- # polylith (28)
- # re-frame (8)
- # sci (7)
- # shadow-cljs (225)
- # spacemacs (10)
- # specter (1)
- # vim (10)
- # xtdb (8)
Is there a way to configure the temp directory location used by build-clj/tools.build during uberjar compilation?
perfect - that worked, thank you
My instinct is to append a !
to any function that isn't homoiconic, e.g. even something that relies on an implicit time seed or something, but in some of the books I've read, I see that pattern really underused imo with tons of functions that aren't really pure, e.g. relying on global state or, more rarely, even altering global state. Any general recommendations?
Note - homoiconic does not mean pure.
I've found Clojure's concept of purity to be different from Haskell's. In Haskell, slurp
is impure, it reads from the environment. In Clojure, slurp is "just a mechanism". It's parameterized, and that parameter could be a URL. That URL could contain a content ID. So whether slurp's beavior is causing a side effect or not depends on the environment slurp is used in.
In contrast, swap!
is something you only do for side effects.
I've gotten a lot out of Rich's The Language of The System. Purity can be considered a "just code" concept. Or you can use values when you design whole systems.
https://www.youtube.com/watch?v=ROor6_NGIWU
In Clojure I feel !
is used as a warning. Any function where you got to be a bit careful, that there might be some gotcha or context specific thing might have a !
at the end,
But some impure things sometimes are straightforward, so they won't always have !
at the end
It's all just a convention, and people do it differently. So the question is what value do you get out of it. If you've found it useful to have !
indicate pure/impure in a strict way, keep doing it. If it's just some added burden but it never really comes in handy, maybe stop.

"doing this operation more than once in a row will have different, stacked results"
is kinda how i read !
at the end of a function name currently
the exclamation point is also for writing to a database, or mutating a variable, in the case of (swap! atom inc)
and (reset! atom val)
@U3X7174KS brings up a fun point that reset!
is a bit special
the !
is indicative of "hey this is different than the usual 'all the same inputs yield all the same outputs every time' functional style"