On Mon, Jul 18, 2011 at 10:04 PM, Chas Emerick <cemer...@snowtide.com> wrote:
> Just as a general comment: just because any of our idiosyncratic functions 
> and macros aren't accepted for inclusion in Clojure proper does _not_ mean 
> that they can't find a full and vigorous life in their own libraries.  
> Clojure is readily extended and improved without adding bits to the language 
> itself, and Clojure development benefits from a very capable dependency 
> management infrastructure; take advantage of it!
>
> In this particular case, I'll bet that someone has an arbitrary threading 
> macro in a library somewhere you can use…or, you can create such a library.  
> Given the number of times this has come up, I'm certain it would find some 
> love.

Given the number of times this has come up, I'd say it's evidence that
something similar really should be in core -- just this once.

I'd go for one that uses a normal symbol, e.g. (-x> a (expr1) (foo a
3) (bar :k a 7) ...) where the symbol to be bound is explicitly
provided by the user.

It isn't desired that often, since collections tend to be the last
argument and maps tend to be the first, but there are some cases where
one changes type partway through (e.g. works on a collection, then
extracts an element and works on that) or a function takes an argument
in an awkward place (e.g. nth takes the collection first, not last).
And as we've noticed, it keeps getting reinvented regularly by new
people.

I actually rarely use any of the threading macros myself, mind.

-- 
Protege: What is this seething mass of parentheses?!
Master: Your father's Lisp REPL. This is the language of a true
hacker. Not as clumsy or random as C++; a language for a more
civilized age.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to