Re: minor grievance with arithmetic on characters

2009-09-11 Thread Stephen C. Gilardi
On Sep 11, 2009, at 10:58 AM, Lauri Pesonen wrote: 2009/9/11 Rich Hickey : We should fix the doc. Patch welcome for this. Ticket #189 - I've provided a patch following Stephen's suggested doc string. Thanks very much! --Steve smime.p7s Description: S/MIME cryptographic signature

Re: minor grievance with arithmetic on characters

2009-09-11 Thread Lauri Pesonen
2009/9/11 Rich Hickey : > > We should fix the doc. Patch welcome for this. Ticket #189 - I've provided a patch following Stephen's suggested doc string. > Rich -- ! Lauri --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: minor grievance with arithmetic on characters

2009-09-11 Thread Rich Hickey
On Tue, Sep 8, 2009 at 5:35 PM, Stephen C. Gilardi wrote: > > On Sep 8, 2009, at 2:14 AM, Timothy Pratley wrote: > >> According to the docstring compare returns -1, 0 or 1: >> user=> (compare \b \g) >> -5 > > We could fix the doc along the lines of: > > "Comparator. Returns a negative number, zero

Re: minor grievance with arithmetic on characters

2009-09-10 Thread ataggart
I'd like to second all of this. The very first time I had to fix someone else's bug was when the dev used "a.compareTo(b) == -1". On Sep 9, 1:37 am, B Smith-Mannschott wrote: > On Tue, Sep 8, 2009 at 23:35, Stephen C. Gilardi wrote: > > > On Sep 8, 2009, at 2:14 AM, Timothy Pratley wrote: > >

Re: minor grievance with arithmetic on characters

2009-09-09 Thread John Harrop
On Tue, Sep 8, 2009 at 8:18 PM, Timothy Pratley wrote: > > Hi Steve, > > I find the -1, 0, 1 result more useful, but am also wary it hides some > useful information. My preference would be to have the doc-string > changed to what you proposed and keep the neg/pos behaviour > of .compareTo in place

Re: minor grievance with arithmetic on characters

2009-09-09 Thread Miron Brezuleanu
Hello, Coming back to the original question: On Tue, Sep 8, 2009 at 6:50 AM, Timothy Pratley wrote: > > Is there a way to deal with this: > user=> (> \a \b) > java.lang.ClassCastException: java.lang.Character cannot be cast to > java.lang.Number (NO_SOURCE_FILE:0) > > So far the only things I kn

Re: minor grievance with arithmetic on characters

2009-09-09 Thread B Smith-Mannschott
On Tue, Sep 8, 2009 at 23:35, Stephen C. Gilardi wrote: > > On Sep 8, 2009, at 2:14 AM, Timothy Pratley wrote: > >> According to the docstring compare returns -1, 0 or 1: >> user=> (compare \b \g) >> -5 > > We could fix the doc along the lines of: > > "Comparator. Returns a negative number, zero,

Re: minor grievance with arithmetic on characters

2009-09-08 Thread Timothy Pratley
Hi Steve, I find the -1, 0, 1 result more useful, but am also wary it hides some useful information. My preference would be to have the doc-string changed to what you proposed and keep the neg/pos behaviour of .compareTo in place. To get -1, 0, 1 requires a 'sign' operator which is handy to have

Re: minor grievance with arithmetic on characters

2009-09-08 Thread Stephen C. Gilardi
On Sep 8, 2009, at 2:14 AM, Timothy Pratley wrote: According to the docstring compare returns -1, 0 or 1: user=> (compare \b \g) -5 We could fix the doc along the lines of: "Comparator. Returns a negative number, zero, or a positive number when x is logically 'less than', 'equal to', or 'g

Re: minor grievance with arithmetic on characters

2009-09-07 Thread Timothy Pratley
According to the docstring compare returns -1, 0 or 1: user=> (compare \b \g) -5 Regards, Tim. On Sep 8, 2:02 pm, Adrian Cuthbertson wrote: > Clojure's compare; > > (compare \a \b) > -1 > > user=> (doc compare) > - > clojure.core/compare > ([x y]) >   Comparator. Retur

Re: minor grievance with arithmetic on characters

2009-09-07 Thread Timothy Pratley
ah nice - perfect thanks On Sep 8, 2:02 pm, Adrian Cuthbertson wrote: > Clojure's compare; > > (compare \a \b) > -1 > > user=> (doc compare) > - > clojure.core/compare > ([x y]) >   Comparator. Returns 0 if x equals y, -1 if x is logically 'less >   than' y, else 1. Same

Re: minor grievance with arithmetic on characters

2009-09-07 Thread Adrian Cuthbertson
Clojure's compare; (compare \a \b) -1 user=> (doc compare) - clojure.core/compare ([x y]) Comparator. Returns 0 if x equals y, -1 if x is logically 'less than' y, else 1. Same as Java x.compareTo(y) except it also works for nil, and compares numbers and collections