On 2018-05-14 15:09:28 Rick McGuire wrote:
> That would be a very bad thing. If the data in the array was a mix of
> numeric and non-numeric values, then some comparisons would be performed
> one way, others differently. You would never be able to get a reliable sort
> result. It would be a little bit like the comparison 
>
> if '0000' = '00e0' then say "Hi" 
>
> giving a true result. Because the "=" operator is used rather than '==',
> the numeric comparison got used because "00e0" is a valid numeric
> representation for zero. In a sort, a lot more comparisons need to be
> performed, so it is important that each one be done using the same set of
> rules, not changing suddenly because of some quirk in the data. 
>
> Again, the sortWith method and the Comparator class were designed to give
> you the flexibility to decide precisely how the comparisons get performed
> if the default does not meet your requirements. 
>
> Rick

        Okay, that makes sense.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Oorexx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to