Fork me on GitHub
Patryk Wilson06:04:51

Hi, I'm using IntelliJ with Cursive and I am getting this error message when I try to run a dummy program I made. This is my error. Cannot execute, please download tools.deps in Settings: Cannot execute, please download tools.deps in Settings

Patryk Wilson06:04:36

This is my path btw with my clj file being within src C:\Users\Cayendo\Programming\FirstClojureProject\src


FYI if you do not get an answer here, there is a #cursive channel, too.


Do you have the Clojure CLI installed? Else you can download in settings I think. Have not used Cursive but used Idea a lot. If you follow the steps, it will work.

Patryk Wilson07:04:31

I do have Clojure CLI installed so not sure what else I need to do


Do you have it in your PATH?


You might have more options in the settings pane of Cursive.


E.g. it might be possible to provide an absolute path to Clojure CLI.

Patryk Wilson17:04:53

I only have a few options of disable and uninstall

Patryk Wilson17:04:31

There are other options as well of managing repositories and HTTP

Patryk Wilson17:04:30

This is the path to my Java home variable, Its labeled as JDK Home Path in IntelliJ if that Matters. C:\Program Files\Java\jdk-13.0.2

Patryk Wilson17:04:40

I have my Clojure CLI Tools located at C:\Program Files\WindowsPowerShell\Modules\ClojureTools


That looks like a PowerShell module. Does the command clojure and clj work outside PowerShell?

Patryk Wilson17:04:33

No it does not


I doubt Cursive can "see" the PowerShell module.


It seems it is possible to use the commands outside powershell like this: Is it possible in Cursive to specify which command to run?

Patryk Wilson19:04:09

Thats seems to have fixed my issues. Thanks a lot


how can I get an ordered hashmap? I know I could use tuples but then I need to rewrite all my code where I already use the keys, or I should duplicate the keywords both as keys and values


There's sorted-map as well, that sorts based on some comparator function. For insertion order, there's nothing in core.


If you create the sorted-map from a coll, you could use map-indexed and add an :order to your items


(It's just Clojure - not ClojureScript though.)


Hi, I'm trying to filter some data and only get the entries that are true, finding out if they are true or false is easy enough, like so: (map #(:is_video %) (hot!)) I want to have the actual full entires of the ones that evaluate to true, not just know whether it's true or false, how would I do something like that? I always end up using filter and nested anonymous functions and getting confused


You use filter. By the way, keywords are functions, so #(map :is_video (hot!)) works. So does (filter :is_video (hot!)).


Okay, noticed the edit. But filter is the right way. Can you share an anonymous function where it is too complex?


It worked the way you proposed! Thanks very much, I was just making it more complex than it actually was and got stuck


NP. For deeply nested logic, it is sometimes helpful to use the threading macros -> and ->>.


if I have a set of numbers, what is the idiomatic way to make a hashmap out of them where the key is just the number and the value is a number converted to string and a fixed string concatenated to it?


something like #{1 2 3} -> {1 "1-thing" 2 "2-thing" 3 "3-thing"}


numbers are not this nice 🙂


I am using a zipmap, map, str combination now

Vincent Cantin11:04:24

typed on cellphone ... (into {} (map (juxt identity #(str % "-thing"))) #{1 2 3})

👍 8

well, that's even more complicated 🙂

Vincent Cantin11:04:12

what is your code?


(zipmap result (map #(str % "-thing) inputs)

Timur Latypoff11:04:26

I personally love "for". (into {} (for [v #{1 2 3}] [v (str v "-thing")])) I think it's much more straightforward than maps, juxts, and zips

Darin Douglass12:04:31

I’d go for zip so here too


why not reduce? I'd do everything in one pass with it:

(reduce #(assoc %1 %2 (str %2 "-thing")) {} #{1 2 3})

Scott Starkey12:04:40

I’m not the OP, but I find these threads incredibly handy, seeing many people approaching a problem from different angles.

Scott Starkey12:04:11

One thing I noticed from @UE35Y835W’s answer: it produced the series out of order. Is that meaningful at all?

(reduce #(assoc %1 %2 (str %2 "-thing")) {} #{1 2 3})
=> {1 "1-thing", 3 "3-thing", 2 "2-thing"}
(The original hashmap is 1, 2, 3; it comes out as 1, 3, 2, which seemed a little weird to me as a beginner.)

Timur Latypoff12:04:12

@UH0FTE610 hashmap does not have a reliable order. It might have one depending on internal implementation, but you should not rely on it. If you want to iterate hashmap in an ordered way, you should sort keys first, and then get values by those keys. If you'd like the hash-map to retain insertion order, you could use a specialized collection for that (you can find some here

👍 4

@UH0FTE610 Practically speaking, if you eval #{1 2 3} , it will yield #{1 3 2} , which means that the reduce function is consuming 3 first. Having said that there's another point to make. The map produced by the reduce function happens to respect the order of insertion until 8 key value pairs. Any number above that will make the key value order completely random. This magic number 8 is not something you should rely on because it might well change in the future. As I said, it just happens to work like that based on the underlining implementation details. 🙂 Hope it's clearer now.


Also, if you need the map to be ordered, I believe you would be better off with a vector of maps, where you can enforce whatever order you want.

Scott Starkey13:04:31

Thank you, @UE35Y835W! The reason I noticed and asked: I had been relying on position in a hash map using positions with the assoc-in function. Perhaps that’s a little dangerous to use. Something like (assoc-in [1 :mykey] "Updated value"). Perhaps I should set up an :id key instead!


In your instance, 1 is not the index but the actual key value, which means that you will always assoc in the right place no matter the actual position of the key 🙂


assoc works on indexes instead of keys only when your collection is for example a vector: (assoc [1 2 3] 3 "add at the end")


@UH0FTE610 In the below example, it specifically looks for the key 1. (assoc {3 :a 2 :b 4 :c 1 :f 10 :t} 1 "new-value")


Huh, does this mean that my zipmap code is also faulty?


yeah, it does, going to use the juxt thing


zipmap is not faulty…. the order the same for both keys and vals.


I didn't say zipmap faulty, I said my code using zipmap is. "zipmap code" != "zipmap"


basically, the read order was different sometimes

ryan echternacht17:04:45

I wrote a macro that seems to work, but when I was testing it with macroexpand it wasn’t returning me anything useful. any tips?


a common gotcha is the need to quote the form

ryan echternacht17:04:28

(defmacro rid3on-> [& forms]
  `(this-is this#
            (rid3-> (.select d3 this#)

app:cljs.user=> (macroexpand '(rid3on-> .transition (.duration 500)))
;; => (rid3on-> .transition (.duration 500))

ryan echternacht17:04:36

^ that’s my macro and the repl result of trying to macro expand it


cljs macros are a different beast

ryan echternacht17:04:09

ah, perhaps that’s why

ryan echternacht17:04:13

I also wrote it as a .cljc if that has any bearing

Shako Farhad17:04:28

Hey guys, do you know how to show a map the way cljs.pprint/pprint does in app as a string? With correct indendation etc? Edit: I figured it out. You need to add

(with-out-str (cljs.pprint/pprint map))


hey team! has anyone taken a course on


i want to purchase the reply driven development course but curious on people's thoughts on these courses. is it worth it?


The REPL-Driven Development course is awesome!


I recommend that course to everyone who really wants to understand how central the REPL is and wants to develop really good practices around it.




ill buy it this weekend then 🙂

Bill Phillips00:04:40

i’m a n00b and i’m going through it, and I’d say it’s useful

👍 4

what would you consider to be the idiomatic way to get the 2nd last item from a vector?


(peek (pop coll))


of course. thanks 🙂


In some cases it might be slightly more efficient to use (my-vec (- (count my-vec) 2)) , since that will not create a new vector (`pop` does, but typically sharing almost all of its memory with the vector being popped). But I expect the performance difference would only be noticeable if that was in a pretty "hot" code path.

💯 8

I kind of find this more readable as well to some extent