How to recover the first occurrences in a list in the prologue amzi?

advertisements

This is so far the .pro file I could think of. I want to print / get / output the first occurrence (=first Head) of "thelist".

thelist([a,b,c,d,e]).

head(H,[H|T]).

Why it always return NO at all time? Thanks


try

...
thelist([H|_]), write(H), nl,
...