Juxtaposition
Posted: Mon Nov 12, 2012 12:49 am
The clojure.core has this juxtapostion function which i find very useful. I wonder how easy is it to implement in newLisp.
I am not worried whether this function returns a vector or a list.
Code: Select all
Takes a set of functions and returns a fn that is the juxtaposition
of those fns. The returned fn takes a variable number of args, and
returns a vector containing the result of applying each fn to the
args (left-to-right).
e.g
((juxt a b c) x) => [(a x) (b x) (c x)]