This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-08-05
Channels
- # admin-announcements (2)
- # beginners (20)
- # boot (13)
- # cider (36)
- # cljs-dev (11)
- # clojure (31)
- # clojure-berlin (3)
- # clojure-czech (2)
- # clojure-dev (2)
- # clojure-japan (9)
- # clojure-russia (16)
- # clojurebridge (3)
- # clojurescript (182)
- # cursive (8)
- # datascript (2)
- # datomic (35)
- # editors (33)
- # hoplon (18)
- # ldnclj (11)
- # off-topic (6)
- # re-frame (3)
- # reagent (39)
anyone have an idea as to why (apply name (keys (:exits loc)))
doesn’t work if there’s multiple k/v pairs in (:exits loc)
?
@benbailey: because name
takes only 1 argument. maybe you meant map
instead of apply
?
hey all. how does one go about configuring pprint
such that it doesn't print symbol/record's namespaces?
If you're new, 'pp' is just an alias established like so: (require '[clojure.pprint :as pp])
hmmm... I'm getting: CompilerException java.lang.RuntimeException: Unable to resolve var: *print-suppress-namespaces* in this context, compiling:
so I have this code (:desc (state/get-room (:east exits)))
that gets a description correctly
if exits
is a hash-map of {:east :hallway, :north :conservatory}
, what’s the best way to get the description of all of the rooms?
@benbailey: If state/get-room
return a map with :desc
as a key, something like this should work (map :desc (map #(state/get-room (% exits)) (keys exits)))
I'm trying to figure out how to correctly control an async go loop (ie, shut it down when I'm done)
I have:
(def ca (async/chan 10))
(def a
(async/go
(loop [i 0]
(println "Running")
(async/>! ca i)
(async/<! (async/timeout 2000))
(recur (inc i)))))
how should I go about shutting down that loop? closing the go block channel sadly doesn't work 😕
Ah, got it. need to check that the >!
returns true in order to recur.
(def ca (async/chan 10))
(def a
(async/go
(loop [i 0]
(println "Running")
(when (async/>! ca i)
(async/<! (async/timeout 2000))
(recur (inc i))))))
I've got some protocols defined in a library with some default implementations of them in that library too, but in another namespace... Then my application requires the namespace, which results in the implementations being loaded.... Strangely when I run the application it seems that the implementations haven't been loaded, but if I nrepl in and re-evaluate the namespace that calls the protocol function it works... any idea what might be going on!?
this stuff did work, and now its stopped - it's all very weird - running clojure 1.6
actually it looks like its happening with two different protocols... one of them if I re-eval the calling namespace it fixes it... the other it doesn't and I have to re-evaluate the required namespace directly... bizzare
ok really weird -- the problem disappears if I run it as an uberjar
feels like a bug somewhere
wondering if its related to checkouts in lein
ok fixed it I'd changed version numbers in a checkouts folder and forgot to re run lein install
That feeling when someone who uses def where a let should be is trying to tell you how to write clojure. I hate my life
Demonstrate a benefit.