Fork me on GitHub

Hi, how do I build a jar? I'm using clojure cli tools

Alex Miller (Clojure team)01:10:10

you'll need to use a tool like depstar or pack, see for some options


Thanks 🙂


what is the idiomatic way to retry something some number of times on exception?


Perhaps not idiomatic, but I've seen this library being recommended:


Hi, I’d like to download a jpg file using clj-http, but I get 451 error from some specific resource (, from which I can get the jpg file using web browser. Here is my code. Am I missing something?

(require '[clj-http.client :as client])

(client/get "" {:as :byte-array})

Jan K12:10:52

It seems they don't like the clj-http user agent setting. You can use (client/get "" {:headers {"User-Agent" "Mozilla/5.0 (Windows NT 6.1;) Gecko/20100101 Firefox/13.0.1"}})


@UCPGSBNQ4 It worked! Thanks a lot!

David Rueda12:10:25

Hello guys, I wanted to share a small project I’ve done for parsing RSA private keys (! While it doesn’t parse successfully all key, it successfully parses the one present in the project’s root directory. The code has a lot of side effect handling functions, manipulating a bytebuffer. Could you help me figure out some of the ways I could use to restrain the side effects into the least amount of cose possible?


is this a study project? why are you reimplementing this yourself?

David Rueda12:10:35

Learn more clojure? Understand ASN.1? I would like to know ways to improve my coding, since I wrote in the beginners channel... If someone wants to help me: thank you in advance !


@UNDFT2492 it's not the purpose of the beginners channel to help you cheating the hiring process

David Rueda08:10:03

😅 did not want to cheat, but really to improve myself. I found it difficult to find a way to make pure functions with this exercise. Moreover, is getting help from the community cheating? I didn’t know about ASN.1: does that mean I should have abandoned without even learning something? I sent my answers yesterday morning before posting this question. You can verify. But thank you for your public suppositions.


for learning about it, looking at the relevant bouncy castle libraries may provide a better experience. or buddy, even

David Rueda08:10:36

That’s what I did. My question here wasn’t about ASN.1, rather about the functional approach of my code and how to do better.


hey, it seems like there are only old versions of clojure and clojurescript on the maven repors ( am i doing something wrong? im trying to install the newst version

Alex Miller (Clojure team)13:10:11

I think the newest ones are on there?

Alex Miller (Clojure team)13:10:40

1.10.520 is the newest ClojureScript and that's there


im always getting Could not find artifact org.clojure:clojure:jar:1.10.520 in central ()


ah clojure version 1.10.0 works and clojurescript 1.10.520?


that could be my mistake 🙂


clojure has a 1.10.1 release as well

Alex Miller (Clojure team)14:10:01

^^ that's latest clojure


Hey, all! 🙂 👋:skin-tone-2: Very often, when one reads the documentation for a function, it says that the function accepts another function as an argument or some map. However, how is one supposed to know what the signature of the input function should be or what the keys of the map are supposed to be. Example:! > Given an AdminClient and a collection of topic descriptors… So how does one know what keys the topic descriptions should have?


I mean, of course, without reading the source code.


Not that I mind reading the source, but I think that such things should be present in the docs, no?


So, essentially, I guess my question is - is it a question of good/bad documentation or is there something I’m missing?

David Rueda14:10:52

I would say that it should be in the function’s documentation too. Otherwise in the documentation of the library.


O.K., got it, thank you 👍


I work at Funding Circle, and I alerted the jackdaw team about this question - it might help us improve our docs


TDD seems to be frowned on these days in the clojure community but one of the advantages of TDD (in addition to ensuring that the first user of some function is it's author) is that it provides a ready-made suite of examples of how to use some function. When trying to use a new library, I tend to check the test-suite to see if there are any examples there of the function I'm trying to use. Ideally a library gets to the maturity level of something like and properly documents all the options but there are a lot of libraries in clojure that aren't yet at that level so it's good to know where to look in the absence of excellent docs.

💯 12

Howdy folx! So I've been on this channel for a while but mostly just sitting back and learning from afar haha. Today though, today I have a question ! I have a hunch that some of you guys are probably involved in the organization of and so this one goes out to you.... I have some questions regarding qualifying for an opportunity grant (I would also like to attend the Intro workshop). On the website it indicates that it is too late to apply... and well... it is admittedly pretty late to apply (whoops, sorry!) lol but I have to ask bc I would really love to attend... Any chance there are any exceptions to be made for a late application? I believe I would be an excellent candidate as am a LGBTQ, young women, self taught student currently ~2 years in. Scheme and clojure were actually my first programming languages!😯 To find out more about me and my coding style check out my blog


+1 for excellent Slack username

😁 4

I am registered for the Conj, and asked on a Conj-ticket-holders on-line forum of one of the organizers your question, and they responded as follows:


"Thanks for asking. The application deadline has already passed for this year. For next year, the link will be posted on the Clojure/conj website and will be announced by via Twitter and other channels. We also send newsletters to the Clojure/conj mailing list, so if someone would like to be added to that, they can email <mailto:[email protected]|[email protected]> with that request. We also update that list every year after conj so that all 1st time attendees get added to the list."


I know someone was asking recently if someone wanted to buy their ticket, at a discounted price. Not sure if that would make a difference in your ability to attend.

👍 4

That person looking to sell their ticket is on this Slack as @U8QBZBHGD but they may have already sold it.

❤️ 4

thank you folx for responding!


@andy.fingerhut what is this online forum you speak of? may be beneficial for me to join


It is one that those registered for the conference are invited to join, before and during the conference. I only asked there because it was easier to find out who one of the organizers was that way. Not open to all, sorry.


All the Clojure technical discussions happen elsewhere, like here on Clojurians Slack. That one is mostly about places to go locally in Durham, arranging board game night, etc. for those attending.


Ah, I see. thanks anyway!


Hi everyone , what is the benefit of binding a partial function to some var

( def some-var (partial some-fn "some-value" ))
vs defining a new function with a closure ?
(defn some-var [another-value] (some-fn "some-value" another-value)) 
with partial binding to a var, we lose the parameter hints from IDE


there is no benefit, you’re right the 2nd is usually preferable

👍 4

@vachichng consider this example:

(def some-arrays
  [[1 2 3]
   [4 5 6]
   [7 8 9 10]])
=> #'user/some-arrays
 (map (partial clojure.string/join ", ") some-arrays)
 (clojure.string/join "\n")
1, 2, 3
4, 5, 6
7, 8, 9, 10
=> nil


partial is one of those things that’s not necessarily your first pick for a lot of tasks, but in some cases it’s handy.

👍 4

imho #() would be clearer there, and I feel it’s pretty much always clearer. but it’s a personal preference


I used to be a big fan of partial but I'm leaning more to #() these days.


tbh I’d probably reach for #() there too, but it was the first example I could think of 😉

Alex Miller (Clojure team)19:10:35

I don't know if I've ever used partial

Alex Miller (Clojure team)19:10:27

I take it back! I found evidence that I used it at least once :)

Alex Miller (Clojure team)19:10:47

looks like I mostly use it in cases where the alternative is #() with %&


ohhhweee well, on the other side.. I'm a pretty big fan of partial 🤷


(just wanted to represent that partial does have some love here) ... and it's not that I can even necessarily defend exactly why it's just one of the tools that I learned early on and so I'm just pretty familiar with it.

Alex Miller (Clojure team)20:10:22

nothing wrong with using partial


for example I've found (filter (partial ...) ...) to be pretty useful in the past


this is my meme about partial


I actually like to think of partial as my cool friend greg who actually brought his own beer to the party 🤷 haha just thought you folx might appreciate

Jason Kimmerling22:10:56

I have some questions regarding a sample code in "Clojure for the Brave and True" (def vamp-keys [:name :glitter-index]) (defn str->int [str] (Integer. str)) (def conversions {:name identity :glitter-index str->int}) (defn convert [vamp-key value] ((get conversions vamp-key) value)) (defn mapify "Return a seq of maps like {:name \"Edward Cullen\" :glitter-index 10}" [rows] (map (fn [unmapped-row] (reduce (fn [row-map [vamp-key value]] (assoc row-map vamp-key (convert vamp-key value))) {} (map vector vamp-keys unmapped-row))) rows))

Jason Kimmerling22:10:21

in the reduce section, what order does it resolve?

Jason Kimmerling22:10:58

I am getting a bit confused on the order of resolution, so it is hard for me to understand why they are doing some of the code


Not sure what you mean by 'resolve' here, but can take a stab at explaining it.


The body of mapify at the 'top level' is (map some-fn rows), where some-fn is most of the code there.


That function takes one argument, unmapped-row, which appears to be a sequence of some number of elements, I'm not sure what they typically look like, but when that anonymous fn is called, once per row, first the arguments to reduce are evaluated, then reduce is called.


Evaluating (fn [row-map ... creates and returns an anonymous function.


Evaluating {} produces an empty map


Evaluating (map vector vamp-keys unmapped-row) maps the function vector over both of the sequences vamp-keys and unmapped-row. Given the value of vamp-keys above, that should return something like ([:name unmapped-row-element-1] [:glitter-index unmapped-row-element-2])


Then reduce is called with those 3 parameters.


Is that anywhere in the neighborhood of what you were asking about?

Jason Kimmerling22:10:17

Yes, I believe so, evaluating the arguments for reduce first makes a good bit of sense, and clarifies it decently. Thanks.


` for code blocks


In general, all Clojure functions, of which reduce is one, and functions you define with fn or defn are also, when they are called, first all of the arguments are evaluated, then the function is called with those resulting values. That isn't necessarily true of Clojure macros -- it depends upon which macro, since each can define its own behavior in that regard.

Jason Kimmerling23:10:26

@andy.fingerhut thanks, I appreciate the clarifications.