I dunno,

Where is this arbitrary point people set where language improvements/
ease-of-use become less important than negligible performance impacts?
I ran several benchmarks, with warm up and correct time measurements,
and didn't get the impression the change was in anyway significant.

Take the existing function. I'm guessing 90+% of all usage is
comparing 2 items, or at least not needing to handle a list of
monotonically decreasing ordered items. Using the performance
argument,  I could suggest stripping out the (next more) check and
instead break it further down into 2 separate functions. And I would
also argue that handling strings, is a more valuable check than
handling monotonically decreasing ordered items.

Not trying to knock your comment, but unless there's more to your
comment not being shared, I'm not sold on it being a real issue.


On Nov 29, 7:45 am, Stuart Halloway <stuart.hallo...@gmail.com> wrote:
> Performance.
>
> > why not change > < type compare functions do a compare on strings as
> > well?
>
> > (defn >
> >    ([x] true)
> >  ([x y](if (string? x)
> >            (. clojure.lang.Numbers (isPos (.compareTo x y)))
> >            (. clojure.lang.Numbers (gt x y))))
> >  ([x y & more]
> >      (if (> x y)
> >        (if (next more)
> >            (recur y (first more) (next more))
> >            (> y (first more)))
> >        false)))
>
> > (defn <
> >    ([x] true)
> >  ([x y](if (string? x)
> >            (. clojure.lang.Numbers (isNeg (.compareTo x y)))
> >            (. clojure.lang.Numbers (gt x y))))
> >  ([x y & more]
> >      (if (< x y)
> >        (if (next more)
> >            (recur y (first more) (next more))
> >            (< y (first more)))
> >        false)))
>
> > It's just cleaner so we can do things like:
>
> > user=> (< "2010-06-11" "2010-11-01")
> > true
>
> > user=> (< "Banana" "Apple")
> > false
>
> > make sense?
>
> > Notes:
> > * I ran a bunch of benchmarks, showing no real impact on performance.
> > * probably would need to include >= and <= too.
>
> > --
> > 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

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