Fork me on GitHub

hi. how to take 5 from a lazy stream, but only unique ones?


(take 5 (distinct (range)))

👍 5

Hey guys, what editor/IDE (other than Emacs or Vim) would you recommend for absolute Clojure beginners?


@U050CT4HR Thanks I'll check it out! The two guys on my team actually did start with VS Code but found the Calva plugin didn't play that well with our setup: figwheel-main, parinfer, tools.deps. I'm not sure if it's one or more of the above. One guy stuck with VS Code and the other is using vim + fireplace like me.


@UBZPYGNAV Please report back on whether Atom works out for you! I'd love to know what to recommend folks in the future.


@U050CT4HR I am firmly in the Atom camp. Booting up Proto-REPL is always a little awkward (maybe I just don't know what I'm doing) but other than that it's seamless.


@UGHNF0CS3 Hey, nice! Glad you're digging it.


I use vim + fireplace myself and got a couple devs on my team to do the same. But other devs are curious and I know they would not want to learn Vim or Emacs. They're used to graphical IDE's like Visual Studio..


IntelliJ with the Cursive plugin served me well


thx @U89EPT9NC Are you using tools.deps or lein/boot?


Some of my colleagues use Cursive (it seems to work well with tools deps)

👍 5

Isn’t Cursive paid?


I think it is for commercial use. Money well spent though


@thiru was using lein, Cursive is paid, there is a free non commercial license. Sadly I'm not working with it anymore. I am trying out VS code with Calva for my personal stuff, not really used to it yet so I might just spring for Intellij and Cursive


Hey everyone, I am writing a small API client library, and was wondering what the most common way of handling exceptional status codes. clj-http, by default, throws exceptions. Would the prefer behavior for my library be to allow the exception, or to catch it and return the actual response?


Maybe have a whack at http-kit: I believe it delivers the error as a key in a map rather than throwing. Another alternative is to create a wrapper function using try around the request, and then deliver it back in the way you want.


Henrik, thanks for your help. Those are great options if I do want to return a response map instead of throwing error. clj-http does also allow passing the map {:throw-exceptions false} to return a map instead of an error. I guess I was asking more existentially, if it is preferred in the clojure community for an api client to throw an exception on unexpected status codes, or if it is better to silently return the response map with a status code of 40x or what have you.


I wanted to use transients to see if I could speed up some code for kicks. I’m using a vector as a stack, an wondered what happened if I used a transient. After changing to (transient []) though, I found empty? breaks. I reworked to not need to call empty, but now peek errors out as well. Would I have been better off dropping down to java.util.Stack at this point?


@risinglight Looks like there is a workaround for peek on transient vectors in


Thanks! I feel better knowing my line of reasoning wasn’t unreasonable