[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] Wanted - Have = Need



Dear Perlies;

Hmm, I seem to recall that part of the reason qsort isn't
used internally in perl is that some versions of qsort could crash if
given 'bad' input. I don't think the reason is related to 'pathological
comparison functions'  (except perhaps comparison functions that crash
some versions of qsort).  Seems 
to me that if the comparison function is non-deterministic then qsort is
bound to barf (or at best, sort non-sensically).  I can dig up references
about this if anyone's interested :)

joshr

On Tue, 17 Oct 2000, John Porter wrote:

> Philip Newton wrote:
> > 
> > I believe Perl used to use the native C library's qsort routine, but now has
> > its own routine due to the poor behaviour of many "native" qsort
> > implementation on pathological comparison functions (that don't return the
> > same result given the same inputs).
> 
> I don't think that's the reason.  After all, perl's sort is also
> not well-behaved under such conditions.  In fact, it's one
> notorious way to get perl to crash!  No, it was mainly about
> speed, as the comments say.
> 
> -- 
> John Porter
> 
> 
> ==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
> ==== Send email to <fwp-request@technofile.org> with message _body_
> ====   unsubscribe
> 


==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe