ord_select ?

"Nicos Angelopoulos" <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <20140212110713.222e8445@ampelos>
Dear all, 

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.

That is 

?- select( a, [a,b,c], R ).
R = [b, c] ;

?- select( d, [a,b,c], R ).
false.


ord_del_element/3 is the closest thing as far as i can see, 
but it does not fail if the element is not in the set.

?- ord_del_element( [a,b,c], d, R ).
R = [a, b, c].


1. am i missing the correct predicate to achieve this ?

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


Regards,

Nicos Angelopoulos
---
http://stoics.org.uk/~nicos/
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.