Lists in Prolog:Transformations can be Expressed Declaratively
colors([r, g, b]).
?- colors(L).
L = [r, g, b]
?- colors([X|Y]).
X = r, Y = [g, b]
% X is the head. Y is the tail.
?- mylist([a, [b, c]]).
Previous slide
Next slide
Back to first slide
View graphic version