Fork me on GitHub
#beginners
<
2022-07-13
>
chucklehead01:07:00

Is there a way to configure the temp directory location used by build-clj/tools.build during uberjar compilation?

hiredman01:07:23

The system property java.io.tmpdir should do it

chucklehead02:07:40

perfect - that worked, thank you

Kamuela12:07:30

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?

teodorlu13:07:01

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

1
didibus19:07:29

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,

didibus19:07:51

This often is the case for impure things

didibus19:07:15

But some impure things sometimes are straightforward, so they won't always have ! at the end

didibus19:07:17

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.

thanks3 1
sova-soars-the-sora15:07:27

"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

teodorlu16:07:25

How does that intuition apply to reset!?

sova-soars-the-sora13:07:28

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"

👍 1
pooriaTaj13:07:31

Hi I am using calva for clojure development , I was wondering if I could disable the IO writing to the output calva file because it is actually putting a heavy load on my system even when the file is closed inside vs code

Stuart16:07:46

Maybe try #calva