This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-06-11
Channels
- # announcements (38)
- # babashka (5)
- # beginners (26)
- # calva (26)
- # cider (1)
- # clj-kondo (36)
- # cljdoc (17)
- # cljs-dev (31)
- # clojure (39)
- # clojure-australia (9)
- # clojure-berlin (2)
- # clojure-dev (31)
- # clojure-europe (22)
- # clojure-france (3)
- # clojure-italy (7)
- # clojure-nl (5)
- # clojure-norway (5)
- # clojure-spec (28)
- # clojure-uk (9)
- # clojured (20)
- # clojurescript (24)
- # community-development (2)
- # conjure (32)
- # core-async (7)
- # cryogen (6)
- # datomic (2)
- # duct (6)
- # fulcro (6)
- # graalvm (53)
- # introduce-yourself (2)
- # jobs (2)
- # luminus (2)
- # nrepl (2)
- # off-topic (35)
- # re-frame (17)
- # reveal (8)
- # shadow-cljs (27)
- # testing (2)
- # xtdb (8)
@manutter51 @noisesmith Thanks! I will test out your suggestions later today. It should also be said that I run the code that calls tap>
in a Thread.
which might add another layer of weirdness.
Here is the whole function:
(defn read-process [proc type jobid] ;; babashka/process
(with-open [rdr (io/reader (type proc))]
(binding [*in* rdr]
(loop []
(let [line (read-line)]
(when (not (nil? line))
(tap> [jobid type line])
(recur)))))))
Here is how it is called:
(.start (Thread. #(read-process bb-process :err jobid)))
(.start (Thread. #(read-process bb-process :out jobid)))
I am practising clojure program where I have 2 variable like below
(def map1 [{:color "Orange" :size 8} {:color "blue" :size 9}] )
(def map2 [{:size 8 :color "Orange" } {:color "yellow" :size 10} {:color "blue" :size 9}])
if any element of map 2
exist in map1
then store in some variable else store in other variable,
I have checked with diff
and compare
did helped me, how can I write best programWhat does @conn
in this context:
(def cfg ...)
(def conn (d/connect cfg))
...
(some-function @conn)
@
is a https://clojure.org/reference/reader#_deref for deref
, so it is just that.
As a side note, database connections are usually put in a delay
, which requires deref
. To ensure the connection is only created when explicitly asked for.
Does it reevaluate the var?
Oh it's a deref?
quote is often helpful - it reveals what the reader expands without evaluating:
user=> '@foo
(clojure.core/deref foo)
it even reveals itself 😄
user=> ''foo
(quote foo)
etc.
user=> '#(+ % %)
(fn* [p1__159#] (+ p1__159# p1__159#))
@noisesmith oh nice. I was doing (type foo)
but this seems to tell me more.
it's not always useful, but it's easy to try and informative when it works
and learning why it works is a big step forward in deep understanding of clojure
Hi, I am trying to update a key in the map
(update {} :match (conj item) )
returning (:match nil) how can I update key by adding new values, I am using this function in reduce
I have a function, which is taking more than 3 minutes complete its operation due to huge data and it is expected, So I am planning to write it in multi threading application, any suggestion ?
I have 2 map which each has more than 100000 map again, I am comparing with another map