develooper Front page | perl.perl5.porters | Postings from July 2004

Re: more 5.9 sort tests

Thread Previous | Thread Next
From:
Ronald J Kimball
Date:
July 21, 2004 07:09
Subject:
Re: more 5.9 sort tests
Message ID:
20040721140940.GA34893@penkwe.pair.com
On Wed, Jul 21, 2004 at 03:12:53PM +0200, Rafael Garcia-Suarez wrote:
> Nicholas Clark wrote:
> > Based on my memory of the thread David figured a way to test sort stability
> > without resorting to overloading, by using <=> and not-really-numbers
> > rather than the complex overloading games I thought of.
> 
> Yes, but in this case what does mean the comment :
> > > > +# test that optimized {$b cmp $a} remains stable (new in 5.9)
> > > > +# without overloading

I think the comment should be:

# test that optimized {$b cmp $a} and {$b <=> $a} remain stable
# (new in 5.9) without overloading

The code definitely needs to use <=>, otherwise it's not testing stability.


Ronald

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About