Re: s-expression levels and higher order functions

2012-07-20 Thread Jay Fields
In https://github.com/jaycfields/jry I define update values, which allows you to (update-values {:a 1 :b 2} inc) ;=> {:a 2 :b 3} I've used that in combination with update-in to do all sorts of transformations. That is obviously designed for maps, which is what your example looks like to me. (

Re: s-expression levels and higher order functions

2012-07-20 Thread Bill Allen
Looks like a good addition for 4clojure. On Jul 19, 2012 8:36 PM, "Alan Malloy" wrote: > No, but it's pretty easy to write: > > (defn map-depth [f coll depth] > (if (zero? depth) > (map f coll) > (for [x coll] > (map-depth f x (dec depth) > > On Tuesday, July 17, 2012 7:17:19

Re: s-expression levels and higher order functions

2012-07-19 Thread Alan Malloy
No, but it's pretty easy to write: (defn map-depth [f coll depth] (if (zero? depth) (map f coll) (for [x coll] (map-depth f x (dec depth) On Tuesday, July 17, 2012 7:17:19 PM UTC-7, Seth Chandler wrote: > > I'm new both to Clojure and to this group, so please be gentle. I com

Re: s-expression levels and higher order functions

2012-07-19 Thread kovas boguta
Hey Seth, Welcome to the party. I haven't seen something like this either. What clojure's map does with additional arguments its pretty useful though. (map f a b c) is equivalent to f@@@Transpose[{a,b,c}] Still, it would be nice to have mathematica-style list manipulation functions, that suppo

s-expression levels and higher order functions

2012-07-19 Thread Seth Chandler
I'm new both to Clojure and to this group, so please be gentle. I come to Clojure mostly from a Mathematica background, which has a certain Lispyness to it. One of the things one can do in Mathematica is to map a function to an s-expression but not at its top level, but rather at some user spe