Lists in Prolog
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