Re: nested map destructuring

2013-03-20 Thread John D. Hume
On Tue, Mar 19, 2013 at 2:58 PM, Jim - FooBar(); wrote: > awsome!...the full thing actually is {{:keys [w1 w2 w3]} :weights u > :uni-probs b :bi-probs t :tri-probs} You might also consider {:keys [uni-probs bi-probs tri-probs]} {:keys [w1 w2 w3]} :weights} -- -- You received this message becau

Re: nested map destructuring

2013-03-20 Thread Alan Thompson
Nice explanation! --Alan On Tue, Mar 19, 2013 at 1:09 PM, Jim - FooBar(); wrote: > nice one...when thinking like there is literally no confusion. > thank you thank you thank you :) > > Jim > > > > On 19/03/13 20:05, Marko Topolnik wrote: > > Think of it in layers, like this---layer 1: > >

Re: nested map destructuring

2013-03-19 Thread Jim - FooBar();
nice one...when thinking like there is literally no confusion. thank you thank you thank you :) Jim On 19/03/13 20:05, Marko Topolnik wrote: Think of it in layers, like this---layer 1: {w :weigths, u :uni-probs, b :bi-probs, t :tri-probs} Then, instead of an atomic w, recursively subst

Re: nested map destructuring

2013-03-19 Thread Marko Topolnik
Think of it in layers, like this---layer 1: {w :weigths, u :uni-probs, b :bi-probs, t :tri-probs} Then, instead of an atomic w, recursively substitute another destructuring form, which will destructure the value of that w (which is also a map). This form is {:keys [w1 w2 w3]}. That gives you co

Re: nested map destructuring

2013-03-19 Thread Jim - FooBar();
On 19/03/13 19:49, Marko Topolnik wrote: {{:keys [w1 w2 w3]} :weights} awsome!...the full thing actually is {{:keys [w1 w2 w3]} :weights u :uni-probs b :bi-probs t :tri-probs} I always get confused when the order changes like that...thanks for unblocking me Marko :) Jim -- -- You receiv

Re: nested map destructuring

2013-03-19 Thread Marko Topolnik
On Tuesday, March 19, 2013 8:39:26 PM UTC+1, Jim foo.bar wrote: > > Hello all, > > can anyone help me destructure the following map in order to access > directly w1 w2 & w3 ? I've been trying for 20 minutes now! (how useless > am I? :( ) > > {:weights {:w1 0.2 :w2 0.3 :w3 0.5} > :uni-probs

nested map destructuring

2013-03-19 Thread Jim - FooBar();
Hello all, can anyone help me destructure the following map in order to access directly w1 w2 & w3 ? I've been trying for 20 minutes now! (how useless am I? :( ) {:weights {:w1 0.2 :w2 0.3 :w3 0.5} :uni-probs {...} :bi-probs {...} :tri-probs {...}} thanks, Jim -- -- You received this mes