Really? I would be interested to hear why; is it maybe because partial
has to take any number of arguments and then (apply even? args)?

I've taken to using partial when I can, precisely because of the
difficulty of nesting anonymous functions, and while performance isn't
a big deal for me I'm curious.

On Aug 23, 12:30 pm, Cameron <cpuls...@gmail.com> wrote:
> Again with the bad examples but...
>
> (map #(even? %) coll) is faster than
> (map (partial even?) coll)
>
> So it's at least got that going for it.
>
> (I know this SHOULD be written as (map even? coll))
>
> On Aug 23, 1:59 pm, Michael Gardner <gardne...@gmail.com> wrote:
>
> > On Aug 23, 2010, at 11:13 AM, Luka Stojanovic wrote:
>
> > > On Mon, 23 Aug 2010 18:01:13 +0200, Joop Kiefte <iko...@gmail.com> wrote:
>
> > >> bad example =/
>
> > >> Yes, it is
>
> > >> but you get the gist I hope
>
> > >> better example: #(first (sort %)) ;)
>
> > > (comp first sort)
>
> > > and #(some-fn x %) can be written as
> > > (partial some-fn x)
>
> > > which leaves #(some-fn % x) as case not trivial with other syntax
>
> > > again (fn [y] (some-fn y x)) is about 8 chars longer, so I guess #() form 
> > > really is not something that should be used that often
>
> > I don't know about you, but I find #(= 2 (count %)) much nicer and easier 
> > to read than (comp (partial = 2) count).
>
>

-- 
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