Re: [eclipse-users] Question about setof/3

From: Ulrich Scholz <ulrich.scholz_at_...11...>
Date: Mon, 30 Oct 2006 10:41:15 +0100
Thank you all for your answers.

Unfortunately, I cannot use a keysort as suggested

> However, I want to stress that the Eclipse sorting builtins (sort/2,4,
> msort, keysort, etc) are significantly faster and it is often preferable
> to use a pattern like my_sort(Random, Sorted) :-

because users are allowed to provide arbitrary comparators that work on
pairs of objects.

I will use the merge sort suggested by Joachim, but with the predicate
halve/3 supplied with list library of ECLiPSe.

In general, I prefer using libraries over writing my own code - and I think
that I wrote enough sorting algorithms in my student years ;-)

> Versions using other sorting algorithms (merge sort, bubble sort etc.)
> are an exercise for the reader ;)

Yours, 

Ulrich

-- 
Ulrich Scholz            

Personal Memory Group                   
European Media Laboratory GmbH
Received on Mon Oct 30 2006 - 09:41:45 CET

This archive was generated by hypermail 2.3.0 : Thu Feb 22 2024 - 18:13:19 CET