clojure key destructuring motivation

2014-01-18 Thread t x
With apologies for 3 questions in 1 day: (def a {:foo {:cat 20 :dog 30} :bar hi}) (let [{{cat :cat dog :dog} :foo bar :bar} a] [cat dog bar]) (leth [{:foo {:cat cat :dog dog} :bar bar} a] [cat dog bar]) I don't understand

Re: clojure key destructuring motivation

2014-01-18 Thread Alex Miller
I have some sympathy for this view of things as it was a question I had while learning Clojure as well. The general justification for the current behavior is that the thing being bound is always on the left and the expression defining it is always on the right. On Saturday, January 18, 2014

Re: clojure key destructuring motivation

2014-01-18 Thread Stefan Kanev
On 18/01/14, Alex Miller wrote: I have some sympathy for this view of things as it was a question I had while learning Clojure as well. The general justification for the current behavior is that the thing being bound is always on the left and the expression defining it is always on the

Re: clojure key destructuring motivation

2014-01-18 Thread Matching Socks
Map keys need to be unique. Therefore, it's tidy for the symbol to be the key to the destructuring map. On Saturday, January 18, 2014 2:57:09 PM UTC-5, Alex Miller wrote: I have some sympathy for this view of things as it was a question I had while learning Clojure as well. The general

Re: clojure key destructuring motivation

2014-01-18 Thread Alex Miller
On Saturday, January 18, 2014 2:19:08 PM UTC-6, Stefan Kanev wrote: On 18/01/14, Alex Miller wrote: I have some sympathy for this view of things as it was a question I had while learning Clojure as well. The general justification for the current behavior is that the thing being