RosettaCodeData/Task/Collections/Prolog/collections-1.pro

12 lines
165 B
Prolog

% create a list
L = [a,b,c,d],
% prepend to the list
L2 = [before_a|L],
% append to the list
append(L2, ['Hello'], L3),
% delete from list
exclude(=(b), L3, L4).