Implementing select/3 in Prolog
<p>I'm new to Prolog and came across this predicate, <code>select/3</code>. I figured how it works though I'm uncertain how I would implement it myself. I think something like:</p>

<pre><code>selec(El,[El|T],T).
selec(El,[H|T],[H|S]) :-
      selec(El,T,S).
select(El,[],[]).
</code></pre>

<p>I know something is wrong. My solution only removes the first occurrence. I want it to remove, all occurrences at some point, just like <code>select/3</code> does.
Any ideas?</p>