Fork me on GitHub

Hi is there a way to rebind *out* to a connected nRepl so some [a subset] of my printlns will go to a specific repl instance?


Something like

(binding [*out* ???]
  (println "Send me to the Repl pls"))
Not sure what goes into the ???


What nrepl client? How is the thread the printing code is running on created?


Some nrepl clients don't seem to support async output at all (the nrepl sending random output whenever)


In this case, messing around w/ IntelliJ (Cursive) nRepl And the program is running as a separate process (started from terminal)


Heya, for some reason I am unable to create, comment on or subscribe to JIRA issues anymore. It always says "You are not authorized to perform this operation. Please log in." But when I try to do that, I am supposedly already logged in but says on the account selection screen that my logged-in account "doesn't have access to Jira on" (even with a freshly created account). Does anyone know what's up with that?

Alex Miller (Clojure team)12:12:32

We only give out jira edit access to people supplying patches (our jira logins are finite). The preferred place for creating and commenting on issues is


IC, thanks! I guess my only gripe then is how to subscribe to issues I'm interested in - JIRA activity isn't synced to so subscribing there doesn't do the trick 😕

Alex Miller (Clojure team)13:12:57

Discussion should mostly happen on ask and you can get notified about ask issues, don't remember what affordances are there to watch

Alex Miller (Clojure team)13:12:49

And I do come back and close the ask issue if we resolve the jira

Alex Miller (Clojure team)13:12:00

It's not perfect, admittedly


Ah cool, I guess that covers at least 95% of my desires then 🙂 Yeah, the usual imperfections of real-world infrastructure I suppose, hehe


Can I update multiple keys in a Map using update ?


Not with a single call. You can use the thread-first macro, though:

user=> (-> {:a 1 :b 2} (update :a inc) (update :b dec))
{:a 2, :b 1}


I guess, but I am using it in a condp macro where I can only provide 1 statement


Any suggestion?


Well actually the threading macro will just do


Yeah, I don't see how condp would prevent you from using ->.

Marc O'Morain13:12:02

I love the new addition to the reify docstring in 1.11. I’m currently reading the reduce doctring and it suffers from the same issue – it explains how the function operates, but not “why”. Would it be helpful to add a one line synopsis? something along the lines of “compute an aggregate result from the values in coll” ?

Alex Miller (Clojure team)14:12:29

file a question on ask ...

👍 1

Does anyone know if the VSCode Calva Jack-in terminal window gets logged somewhere?

Noah Bogart15:12:45

probably best to ask in #calva


just saw I am only in a select set of channels, will do thanks.

Noah Bogart15:12:36

glad to help! I’d recommend looking through the channel list, joining (and then muting) the channels for various libraries you use. it’s a great way to get feedback/help without being overwhelmed by too many notifications lol

👍 1

For the #calva channel, especially if you mute it, please consider adding a Notification Keyword calva friend. I use that for announcement type messages. Then slack will badge the channel for those messages.

👍 1
Noah Bogart16:12:49

oh that’s excellent, i didn’t realize you did that


Maybe I should advertise it a bit. 😀


Any suggestion on how to thread only once without having to use as-> ?


I believe you can just

(-> "./input/day2input.txt"
    (->> (map #(split % #" "))
         (map (fn [[x y]] [x (Integer/parseInt y)]))
         (into [])))
the thread first will plop it in the first position and the thread last will do the right thing from there


or you can combine the first few

(->> (split-lines (slurp "./input/day2input.txt"))
     (map #(split % #" "))
     (map (fn [[x y]] [x (Integer/parseInt y)]))
     (into []))


Oh right


Very good point, thank you


(->> (split-lines (slurp "./input/day2input.txt"))
     (map #(split % #" "))
     (mapv (fn [[x y]] [x (Integer/parseInt y)])))


don’t need the last into with a mapv


That I did not know either

Björn Ebbinghaus16:12:43

What most people overlooked is that I provided an implementation you can use with… :-)

user=> (require '[io.github.vlaaad.tweet-def :as tweet])
user=> (tweet/def "")
  (mapv int)
  (update 0 inc)
  (map char)
  (apply str))


(yeah, advent of code) trollface


I am wanting learn more about how the basic clojure macros (def, defn, let*, if), etc. are implemented, but haven't been able toe easily find where they are defined, can someone point me in the right direction?

Alex Miller (Clojure team)17:12:37

they are mostly implemented in the Compiler as they are special forms

Alex Miller (Clojure team)17:12:56

you have to bottom out somewhere - this is the place! :)


I see, thanks

Alex Miller (Clojure team)17:12:53

the parse method is parsing a let* form, the doEmit is emitting Java bytecode


From the list you mentioned defn is a relatively simple macro JFYI you can always run (source macro/fn-name) from the repl to see how functions and macros are implemented in the CLJ language. Though as pointed out def and if, let* are unique axioms of the language.


It also helps if your editor has go-to functionality but I tend to just run (source) fn from repl.


Thanks @chesslunatic. I was confused because on the source it seems like defn is declared with def but now I see that afterwards there is a call to (. (var defn) (setMacro)) which I suppose does some sort of conversion of it to a macro.

Alex Miller (Clojure team)18:12:15

a macro is just a function that takes code data and returns data

Alex Miller (Clojure team)18:12:28

the flag is what tells the compiler to expand when it analyzes