Fork me on GitHub
#clojure
<
2016-08-07
>
lambeta00:08:49

I’ve a little curious about map destructing, why design the values to be followed by keywords other than in reverse order? for example (let [{key :key} {:key 'hello}] key ) other than (let [{:key key} {:key 'hello}] key)?

seancorfield01:08:11

You almost never see that format (unless you need to rename the variables that are bound). Normally you'd see (let [{:keys [key]} {:key 'hello}] key)

gfredericks01:08:14

both options are weird

gfredericks01:08:48

the other one is weird because it reverses the ordering of names and values in normal let bindings

Alex Miller (Clojure team)01:08:29

That is the reasoning - local symbols being bound are kept on the left

Alex Miller (Clojure team)01:08:52

It's tempting when learning to reason from sequential destructuring that it's matching shapes or something but you should let that idea go (I had the same struggle)

hiredman01:08:37

more practically, a map literal is a map, so for a binding like (let [{a :a b :a} {:a 1}] ...), if the syntax had the keys and values reversed it wouldn't work

gfredericks02:08:48

And the :as, :keys, :strs, and :syms features would look much weirder the other way

adamw07:08:02

hmm, any ideas how best to do this? I have n clojure.core.matrixes of identical dimensions. I want to generate a matrix where each element is a sequence of all elements in the inputs matrix at that position.

adamw07:08:17

The only way I can think of doing this is sth like

clojure
(let [fstm (first matrices)]
  (for [row (range (row-count fstm))]
    (for [col (range (column-count fstm))]
      (map (mget row col) matrices))))

adamw07:08:26

but that seems suboptimal

adamw09:08:22

of course I just realised emap like map takes a variable # of args

adamw09:08:33

so I can just (apply emap:)

adamw09:08:36

(apply mat/emap (fn [& els] els) mats)

yonatanel14:08:56

So what's the sanest way to call SOAP interfaces with clojure?

nilrecurring14:08:23

Hi! Is there any tool/lib to graph the function calls in a codebase?

nilrecurring14:08:13

I mean something with graphviz with arrows from callee to called, and preferably with namespaces as boxes

nilrecurring14:08:33

I tried googling but only found broken stuff

nilrecurring14:08:19

Use case is to have a visual hint to know if there is any dependency mess/namespace that could be factored out

gfredericks16:08:23

might've been in your collection of "broken stuff" I suppose

lambder16:08:35

hello, can anyone please tell me how to configure build.boot so changes to backend are watched and system is auto reset?

lambder16:08:35

it has clojurescript auto rebuild and reloaded but not backend

lambder16:08:48

when I connect via nrepl and do: (reset)

lambder16:08:59

then the backend reloaded as expected

lambder16:08:11

how can I have it automatically?

pesterhazy17:08:51

@lambder, probably better to ask in the #C053K90BR channel

akiva20:08:10

Hi, gang, I alphabetize my dependencies and ns requires. Any compelling reason not to do this? Basically, not sure how/if they cascade.

gfredericks20:08:08

it should be fine; if there's an ordering sensitivity that indicates a bug somewhere

akiva20:08:07

That’s kind of what I’ve been assuming.