Fork me on GitHub
#rum
<
2016-12-08
>
kauko18:12:51

@martinklepsch is there a typo in the changelog? (let [{:keys [:product/text]} (d/react-all state)]

martinklepsch18:12:48

@kauko: what specifically are you referring to?

kauko18:12:14

shouldn't product/text be a.. not a keyword?

kauko18:12:44

I've never seen that kind of destructuring syntax

martinklepsch18:12:20

I don't think so. I briefly checked the destructing docs on http://clojure.org but basically you cannot have namespaced local bindings

martinklepsch18:12:00

So you pass a keyword and there will be a binding for the part after the /

kauko18:12:32

Huh, cool. So you'd refer to that value with the name text?

martinklepsch18:12:35

I could be wrong though, it's certainly something I haven't used extensively

rauh18:12:35

Yeah i think it was acciental though that the destructing works by using a keyword, it should be {:keys [product/test]} technically

rauh18:12:00

If you're on 1.9 {:product/keys [test]} is also pretty nice

martinklepsch18:12:49

@rauh: all (?) examples here show the keyword syntax http://clojure.org/guides/destructuring

rauh18:12:36

Hmm you're right, oops 😕

martinklepsch18:12:04

That nice snippet doesn't allow multiple bindings somehow does it?

martinklepsch18:12:59

Ah ok no I get it now

martinklepsch18:12:39

You can namespace the usual :keys thing which will then look up keys with the same namespace - cool! 👌🎉