Re: searching for a good name thread-let, thread-with, thread-thru

2011-02-08 Thread Ken Wesson
On Sat, Feb 5, 2011 at 10:36 AM, Jason wrote: > How about > >  (%-> >     starting-value >     (foo 3 %) >     (bar % arg2 arg3)) > > This combines the standard shorthand argument form from the inline > function with the threading. I also like be because the '%' stands > out. And this also presum

Re: searching for a good name thread-let, thread-with, thread-thru

2011-02-08 Thread Mark Fredrickson
I wanted to see how long this thread would go before someone linked to the old stuff. :-) Despite turning up repeatedly, the issue has never been put to bed. I suspect it is the name. There has been no consensus, as this thread demonstrates. I vote for one I haven't seen yet. `=>`. It's two charac

Re: searching for a good name thread-let, thread-with, thread-thru

2011-02-08 Thread Meikel Brandmeyer
Hi, Am 08.02.2011 um 22:11 schrieb B Smith-Mannschott: > Ah. Indeed. And Mark Fredrickson's "let->" is equivalent to my > thread-with macro. I even considered the name let->. I guess there's > no wheel that can't be reinvented. ;-) Yeah. Once per year or so. ;) Sincerely Meikel -- You receive

Re: searching for a good name thread-let, thread-with, thread-thru

2011-02-08 Thread B Smith-Mannschott
On Tue, Feb 8, 2011 at 22:05, Meikel Brandmeyer wrote: > Ah. A classic: > http://groups.google.com/group/clojure/browse_thread/thread/66ff0b89229be894/c3d4a6dae45d4852 > > Some more names in this old thread. > > Sincerely > Meikel Ah. Indeed. And Mark Fredrickson's "let->" is equivalent to my th

Re: searching for a good name thread-let, thread-with, thread-thru

2011-02-08 Thread B Smith-Mannschott
On Sat, Feb 5, 2011 at 16:36, Jason wrote: > How about > >  (%-> >     starting-value >     (foo 3 %) >     (bar % arg2 arg3)) > > This combines the standard shorthand argument form from the inline > function with the threading. I also like be because the '%' stands > out. This, or something very

Re: searching for a good name thread-let, thread-with, thread-thru

2011-02-08 Thread Meikel Brandmeyer
Ah. A classic: http://groups.google.com/group/clojure/browse_thread/thread/66ff0b89229be894/c3d4a6dae45d4852 Some more names in this old thread. Sincerely Meikel -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to c

Re: searching for a good name thread-let, thread-with, thread-thru

2011-02-08 Thread Jason
How about (%-> starting-value (foo 3 %) (bar % arg2 arg3)) This combines the standard shorthand argument form from the inline function with the threading. I also like be because the '%' stands out. On Feb 4, 3:05 pm, B Smith-Mannschott wrote: > Clojure's threading macros -> a

Re: searching for a good name thread-let, thread-with, thread-thru

2011-02-05 Thread B Smith-Mannschott
On Sat, Feb 5, 2011 at 10:14, B Smith-Mannschott wrote: > I considered that, but decided against it because vector is the > conventional syntax for variable bindings in Clojure (let, fn, > defrecord, ...) Once I'd decided to do that, it became clear that the > first of the forms would become the

Re: searching for a good name thread-let, thread-with, thread-thru

2011-02-05 Thread B Smith-Mannschott
On Sat, Feb 5, 2011 at 00:19, Michael Ossareh wrote: > On Fri, Feb 4, 2011 at 12:05, B Smith-Mannschott > wrote: >> >> I came up with this macro, but I'm unsure what to call it: >> >> (defmacro thread-let [[varname init-expression :as binding] & expressions] >>  {:pre [(symbol? varname) >>      

Re: searching for a good name thread-let, thread-with, thread-thru

2011-02-04 Thread Hugo Duncan
On Fri, 04 Feb 2011 15:05:39 -0500, B Smith-Mannschott wrote: What should I name this thing? I'm concerned that "thread" is confusing due to its dual meaning. let seems in line with clojure conventions. (thread-let [x ...] ...) (thread-with [x ...] ...) (thread-through [x ...] ...) (let-> [x

Re: searching for a good name thread-let, thread-with, thread-thru

2011-02-04 Thread Michael Ossareh
On Fri, Feb 4, 2011 at 12:05, B Smith-Mannschott wrote: > I came up with this macro, but I'm unsure what to call it: > > (defmacro thread-let [[varname init-expression :as binding] & expressions] > {:pre [(symbol? varname) > (not (namespace varname)) > (vector? binding) >

Re: searching for a good name thread-let, thread-with, thread-thru

2011-02-04 Thread Alan
Missing some parens there. Should be (->> (take 2)), of course. On Feb 4, 12:53 pm, Alan wrote: > Another solution, which is not especially satisfying but is worth > considering, is to use the most-common thread style at the top level, > and interweave some exceptions for the less-common style. >

Re: searching for a good name thread-let, thread-with, thread-thru

2011-02-04 Thread Alan
Another solution, which is not especially satisfying but is worth considering, is to use the most-common thread style at the top level, and interweave some exceptions for the less-common style. (-> 10 range 20 (->> take 2)) or (->> 10 (#(range % 20)) (take 2)) On Feb 4, 12:05 pm

Re: searching for a good name thread-let, thread-with, thread-thru

2011-02-04 Thread Ken Wesson
On Fri, Feb 4, 2011 at 3:05 PM, B Smith-Mannschott wrote: > (defmacro thread-let [[varname init-expression :as binding] & expressions] >  {:pre [(symbol? varname) >         (not (namespace varname)) >         (vector? binding) >         (= 2 (count binding))]} >  `(let [~@(interleave (repeat varna