Very good point Meikel.  The only reason I wrote the code that way is
I was asking myself "What if I had Rich's Job?  How would I write
reduce?"  I should have been more explicit.

On Oct 4, 7:42 am, Meikel Brandmeyer <m...@kotka.de> wrote:
> Hi,
>
> I second Sean's view: dispatching a multimethod on argument count is  
> possible, but maybe not the clearest use of multimethods. I would also  
> prefer the multiple arglist approach.
>
> Am 03.10.2009 um 21:39 schrieb Sean Devlin:
>
> > (defn reduce
> >  ([f coll] (reduce f (first coll) (rest coll)))
> >  ([f init coll] (reduce stuff...)))
>
> Note, that the first reduce call can also simply be written as (reduce  
> f coll).
>
> Sincerely
> Meikel
>
>  smime.p7s
> 3KViewDownload
--~--~---------~--~----~------------~-------~--~----~
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