Fork me on GitHub
#calva
<
2019-08-23
>
johnjelinek02:08:26

how do I get calva to print stuff out in Calva says when I eval something with a println? It's only showing return values ... I have to jump out of my file and execute in a repl to see the io

johnjelinek02:08:02

well, even if I use the Calva REPL, I can't see the output I expect:

main=> 
(defn take-and-print [channel prefix]
  (go-loop []
    (println prefix ": " (<! channel))
    (recur)))

main=> 
(take-and-print subscriber-one "subscriber-one")
#object[clojure.core.async.impl.channels.ManyToManyChannel 0x2913b5fe "clojure.core.async.impl.channels.ManyToManyChannel@2913b5fe"]

main=> 
(go (>! publisher {:topic :change-page :dest "/#home"}))
#object[clojure.core.async.impl.channels.ManyToManyChannel 0x908493a "clojure.core.async.impl.channels.ManyToManyChannel@908493a"]

johnjelinek02:08:56

so I'm expecting my REPL to flow in with printlns

johnjelinek03:08:04

if I'm in rebel-readline, I get:

user=> (go (>! publisher {:topic :account-created :username "billy"}))
#object[clojure.core.async.impl.channels.ManyToManyChannel 0x3a1e5fa7 "clojure.core.async.impl.channels.ManyToManyChannel@3a1e5fa7"]subscriber-one :  {:topic :account-created, :username billy}

subscriber-two :  {:topic :account-created, :username billy}

johnjelinek02:08:46

in calva, if I (ns 'main) it still prompts that I'm in user=> even though: user=> *ns* ; => #namespace[main]

bringe23:08:01

Is pretty printing still broken in the repl window? I see this instruction at the top of the repl window:

ctrl+enter: to submit the current line and pretty print the results
But when I do that it looks very unreadable (at least with a large map I'm working with). If I call clojure.pprint/pprint it looks good as usual. I noticed the command ctrl+alt+c, p pretty prints correctly to the calva says window, however.