Fork me on GitHub
#clojure
<
2017-06-18
>
noisesmith01:06:19

@bradford where does add-work-item get called?

noisesmith01:06:18

also you mention POST but I only see a GET handler there

bradford03:06:09

@noisesmith I misspoke -- add-work-item gets called by a Littleproxy server, in request threads.

kwladyka06:06:35

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?

kwladyka06:06:21

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?

hlolli08:06:36

10,000th memeber was @ayush (or @valyagolev )

pwrflx09:06:31

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?

nathanmarz12:06:58

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}}}

nathanmarz12:06:08

if there's other data structures involved in the nesting, it's an easy modification to all-maps to handle it

lepistane15:06:11

anyone from Serbia going to the EuroClojure in Berlin next month?

lepistane15:06:39

BTW lets celebrate 10k people on CLJ slack channel 😄

jumar18:06:57

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...

noisesmith18:06:50

what version of clojure are you using?

jumar18:06:18

1.9.0-alpha16

jumar18:06:06

just switched to alpha17 -> same result

kwladyka18:06:13

@jumar as i can see in the doc what you linked it has to be with keys and it is correct

jumar18:06:00

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.

kwladyka18:06:18

oh, but not true, it shouldn’t throw exception. My mistake.

mobileink18:06:32

Hi folks. Looking for feedback/contribs for https://miraj-project.github.io/

kwladyka18:06:34

it works for me with [org.clojure/clojure "1.9.0-alpha15"]

mobileink18:06:50

This is pure functional Clojure for web programming including seamless support for web components (Polymer)

noisesmith18:06:24

+user=> *clojure-version*
{:major 1, :minor 9, :incremental 0, :qualifier "alpha15"}
+user=> #::{:a 1, :b 2}
#:user{:a 1, :b 2}

noisesmith18:06:20

@jumar the error is in leiningen not clojure itself

noisesmith18:06:14

+$ lein run -m clojure.main
Clojure 1.9.0-alpha17
user=> #::{:a 1, :b 2}
#:user{:a 1, :b 2}
user=> 

noisesmith18:06:28

probably more specifically an nrepl bug, not leiningen itself

noisesmith18:06:47

since run -m clojure.main makes it skip nrepl, and that works

jumar18:06:23

hm, interesting - @noisesmith thanks for finding the source of bug 😉

kwladyka19:06:02

@jumar check maybe if you have something here cat ~/.lein/profiles.clj what can cause it

noisesmith19:06:04

@kwladyka it's an nrepl bug, even removing my entire project.clj doesn't fix it

Alex Miller (Clojure team)19:06:37

Prob just not using a new enough reader that supports namespace map syntax

noisesmith19:06:53

but then keys would fail too? it's weird that keys would work but the literal at the top level does not

aromo21:06:24

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!