% mymember.pl:  If you use the member function to search for any item but
% the last, you will discover that it wants to keep searching.  We know
% that the addition of a cut would prevent that.  So, why is member
% implemented without a cut?
%
% The simple answer is repetition.  The name "member" might make you
% think of set membership, but member is more flexible than that.  Consider:
%
%   ?- member(a,[a,b,a,b]).
%   true ;
%   true ;
%   false.
%
% By allowing member to backtrack, we can use it for set
% membership, and we can use it to count the number of appearances of
% a list element.
%
% Another, related reason:  If we do not care for member
% to backtrack, we can simply follow it with a cut of our own.
% That is all this example does: mymember is just a call to member
% followed by a cut.  If used on the above example:
%
%   ?- mymember(a,[a,b,a,b]).
%   true.
%
% Had member included its own cut, we would need to write
% our own version of member, from scratch, to avoid that behavior.

mymember(Element,List) :- member(Element,List), !.
