Re: ord_select ?

Michael Hendricks <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <CAFHuXuahGHPkDOpvaf+85rij2_wChWnHz6UO5MzZN0aFpHj2dQ@mail.gmail.com>
On Wed, Feb 12, 2014 at 4:07 AM, Nicos Angelopoulos <
[email protected]> wrote:

> in library  library(ordsets) I would like to have the  same behaviour as
> select/3 for lists,
> in that if the element is not in the set the predicate should fail.
> ...
> 1. am i missing the correct predicate to achieve this ?
>

Since ordsets are implemented as lists, you should be able to use select/3
directly.


> 2. would it make sense to include some such like predicate to the library?
>

That seems reasonable to me.  For large ordsets, a specialized version of
select/3 could get better performance by utilizing the sort order.

-- 
Michael
-------------- next part --------------
HTML attachment scrubbed and removed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.