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

From: Ulrich Scholz <ulrich.scholz_at_eml.org>
Date: Fri, 27 Oct 2006 11:27:46 +0200
> > Hi everybody,
> > 

> > a question about setof/3: The manual states that the result is sorted
> > but I could not find according to which ordering.  I guess, it's the
> > standart term order.

> > How could an implementation of setof/3 look like that uses an arbitrary,
> > i.e., user-supplied ordering?

> Use bagof/3 (or the faster findall/3), and sort the resulting list
> afterwards.

I need to sort the result of bagof/3 according to a user-supplied function.
I thought of something like the Java function "sort(List,Comparator)" in
java.util.Collections, e.g., a predicate sort/3 with 
sort(+Comparator,+Random,-Sorted).  I did not find anything similar in the
Referendce Manual.

Can you suggest me some code that I could reuse?

Thank you,

Ulrich  

 
-- 
Ulrich Scholz            

Personal Memory Group                   
European Media Laboratory GmbH
Received on Fri Oct 27 2006 - 10:28:17 CEST

This archive was generated by hypermail 2.2.0 : Thu Feb 02 2012 - 02:31:57 CET