This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-08-01
Channels
- # announcements (1)
- # beginners (71)
- # calva (12)
- # cider (3)
- # clj-kondo (12)
- # cljsrn (9)
- # clojure (167)
- # clojure-dev (21)
- # clojure-europe (5)
- # clojure-italy (60)
- # clojure-nl (6)
- # clojure-spec (6)
- # clojure-uk (60)
- # clojurescript (86)
- # core-async (25)
- # cursive (21)
- # datascript (9)
- # datomic (4)
- # figwheel (8)
- # fulcro (7)
- # graalvm (4)
- # jackdaw (6)
- # jobs (8)
- # juxt (2)
- # leiningen (1)
- # malli (1)
- # off-topic (20)
- # re-frame (31)
- # reagent (5)
- # remote-jobs (3)
- # shadow-cljs (57)
- # sql (6)
- # vim (9)
Newb question: I’m trying to prn
a value from within a go block in the JVM, just to make sure things are wired up right. Is it ordinary behaviour for no output to happen? I can confirm that the <!
in the go block is working by conjing the value onto a vector in an atom and dereffing.
I’m using vim/nrepl/fireplace so I’m wondering if the output is just getting swallowed in that chain someplace.
So if prns in a future get swallowed in your tool chain of choice (ouch, that is rough) then that will often happen with go blocks
Is that actually right @hiredman ? prn will print to *out*
. Futures do binding conveyance but do go blocks? I don’t know off the top of my head
If not, then printing would go to stdout instead of whatever you rebound to
Go blocks do binding conveyance, they capture the binding frames in the array and restore them
The thing I don't recall is if go blocks will run on the current thread up until the first channel operation, which would behave differently from futures
I think I have a fundamental misunderstanding here and would appreciate some help … even from clj
this code doesn’t print anything https://gist.github.com/rgm/dff54483f0705918191f48d461b33687
(this is that vim business earlier, except I think I’ve messed up somewhere and it can’t be the vim/fireplace pipeline).
oh, you’re right … I think it is nrepl… I forgot that my ~/.deps had that included by default.
@ghadi is it your recommendation to follow this strictly? So no logging at all in the context of a go-block?
@ghadi @hiredman @alexmiller thanks for helping … yep, the prn is getting swallowed by nrepl. Guess I’ll try that same code with prepl out of curiosity (notwithstanding the general idea of don’t-do-IO-in-go-blocks).
@ghadi is it your recommendation to follow this strictly? So no logging at all in the context of a go-block?