Re: new fn: juxt - Theory & application

2009-12-18 Thread Alex Osborne
Just tossing up some non-juxt alternatives for comparison's sake, so we can see where it is an improvement. Sean Devlin writes: > Notice that juxt creates a closure. The most straightforward case is > to *predictably* access multiple values from a map. > > user=>(def test-map {:a "1" :b "2" :c

Re: new fn: juxt - Theory & application

2009-12-18 Thread Sean Devlin
Laurent, 1. You are correct. juxt returns a vector. This is based on some old articles I wrote, and I must of missed those references. 2. Guilty :) The partial is (deliberate) overkill. Sean On Dec 18, 4:17 am, Laurent PETIT wrote: > Hello, > > 2009/12/18 Sean Devlin > > > > > > > Hello ev

Re: new fn: juxt - Theory & application

2009-12-18 Thread Laurent PETIT
Hello, 2009/12/18 Sean Devlin > Hello everyone, > Today I'd like to shed some light on a new funciton in 1.1, juxt. In > order to understand juxt(apose), I'd like to first talk about comp > (ose). Comp can be defined in terms of reduce like so: > > (defn my-comp [& fns] > (fn [args] >(red

new fn: juxt - Theory & application

2009-12-17 Thread Sean Devlin
Hello everyone, Today I'd like to shed some light on a new funciton in 1.1, juxt. In order to understand juxt(apose), I'd like to first talk about comp (ose). Comp can be defined in terms of reduce like so: (defn my-comp [& fns] (fn [args] (reduce (fn[accum f](f accum)) (conj (