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 support a richer syntax.
In particular I often want versions of Take and Drop that support
ranges, and multidimensional manipulation.
As far as I know no one has built these things out yet, but im sure it
would be a good exercise ;)
On Tue, Jul 17, 2012 at 10:17 PM, Seth Chandler <[email protected]> wrote:
> 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 specified
> level. Thus Map[f, {{a,b},{c,d}},{2}] will (because of the {2} as the last
> argument) evaluate to {{f[a],f[b]},{f[c],f[d]}} rather than
> {f[{a,b}],f[{c,d}]}. I have found this capability of having functions that
> work at levels of an expression to be extremely valuable. Is there work
> already done that extends the higher order functions to permit something
> like this. And, yes, I am sure one could write a macro and perhaps that has
> already been done, but I was curious as to what was out there. My Google
> search did not yield much on this topic, but perhaps I used the wrong
> Clojure vocabulary.
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to [email protected]
> Note that posts from new members are moderated - please be patient with your
> first post.
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en