-
Notifications
You must be signed in to change notification settings - Fork 157
Open
Description
Documentation header for select/3 currently states,
select(X, Xs0, Xs1)
Succeeds when the list Xs1 is the list Xs0 without the item X
But this is inaccurate, since Rem is not entirely "without 1" in this example:
?- select(1, [1,2,3,2,1], Rem).
Rem = [2,3,2,1]
; Rem = [1,2,3,2]
; false.For ease of reference, current definition is:
%% select(X, Xs0, Xs1).
%
% Succeeds when the list Xs1 is the list Xs0 without the item X
%
% ```
% ?- select(c, "abcd", X).
% X = "abd"
% ; false.
% ```
select(X, [X|Xs], Xs).
select(X, [Y|Xs], [Y|Ys]) :- select(X, Xs, Ys).Metadata
Metadata
Assignees
Labels
No labels