This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-06-18
Channels
- # beginners (13)
- # boot (2)
- # cider (5)
- # cljs-dev (47)
- # cljsrn (5)
- # clojure (34)
- # clojure-berlin (2)
- # clojure-russia (33)
- # clojure-serbia (10)
- # clojure-spec (24)
- # clojurebridge (1)
- # clojurescript (21)
- # code-reviews (8)
- # core-matrix (4)
- # datomic (11)
- # hoplon (1)
- # jobs (1)
- # leiningen (4)
- # lumo (4)
- # off-topic (12)
- # om (3)
- # parinfer (4)
- # pedestal (3)
- # proton (1)
- # reagent (3)
- # ring-swagger (2)
- # rum (2)
- # untangled (9)
- # vim (6)
@bradford where does add-work-item get called?
also you mention POST but I only see a GET handler there
@noisesmith I misspoke -- add-work-item gets called by a Littleproxy server, in request threads.
In best practices what names are you using for transducers functions like (def foo (map f))
or (def foo (comp … ))
? foo->bar, xfoo, xbar, xfoo->xbar, etc.? 🙂 Do we have some best practices about naming for that?
Or you really don’t care about difference in naming between (def foo (map f))
and (defn foo [x] (map f x))
as long as it is doing the same thing?
10,000th memeber was @ayush (or @valyagolev )
hi! I've got a nested map, and I'd like to recursively change the values that are bound to keys named "date".. do I need a zipper for such or is there something easier?
if it's just nested maps, you can do this:
(def data {:a 1 :date 3 :b {:c {:date 4 :d 2}}})
(let [all-maps (recursive-path [] p (if-path map? (continue-then-stay MAP-VALS p)))]
(transform [all-maps (must :date)] inc data)
)
;; => {:a 1, :date 4, :b {:c {:date 5, :d 2}}}
if there's other data structures involved in the nesting, it's an easy modification to all-maps
to handle it
While reading through https://clojure.org/guides/weird_characters - section about Namespace Map Syntax - I tried the code in REPL: Following works:
clojure-repl.core=> (keys #::{:a 1, :b 2})
;=> (:clojure-repl.core/a :clojure-repl.core/b)
But without keys
it doesn't work:
#::{:a 1, :b 2}
;; =>
RuntimeException EOF while reading, starting at line 1 clojure.lang.Util.runtimeException (Util.java:221)
:b
2
RuntimeException Unmatched delimiter: } clojure.lang.Util.runtimeException (Util.java:221)
Why is that?
Especially if #:person{:a 1, :b 2}
works without problems...what version of clojure are you using?
@jumar as i can see in the doc what you linked it has to be with keys
and it is correct
yes, I can see that example in the doc but I'm wondering what's the reason it doesn't work and why using #:person{:a 1, :b 2}
works without problems - I'd expect both of them being OK.
Hi folks. Looking for feedback/contribs for https://miraj-project.github.io/
This is pure functional Clojure for web programming including seamless support for web components (Polymer)
+user=> *clojure-version*
{:major 1, :minor 9, :incremental 0, :qualifier "alpha15"}
+user=> #::{:a 1, :b 2}
#:user{:a 1, :b 2}
@jumar the error is in leiningen not clojure itself
+$ lein run -m clojure.main
Clojure 1.9.0-alpha17
user=> #::{:a 1, :b 2}
#:user{:a 1, :b 2}
user=>
probably more specifically an nrepl bug, not leiningen itself
since run -m clojure.main makes it skip nrepl, and that works
hm, interesting - @noisesmith thanks for finding the source of bug 😉
@jumar check maybe if you have something here cat ~/.lein/profiles.clj
what can cause it
@kwladyka it's an nrepl bug, even removing my entire project.clj doesn't fix it
Prob just not using a new enough reader that supports namespace map syntax
but then keys would fail too? it's weird that keys would work but the literal at the top level does not
I vaguely recall hearing somewhere that there was a talk at one of the Clojure conferences about using clojure.spec with languages other than Clojure. I thought that the speaker might have been Carin Meier but that's probably not right as I can't find it. Can anyone point me to such a talk (if in fact it exists)? Many thanks!