Re: Why does this recursion not work?



Hi,
May be it does not work because there is no clause for
last(tail(Something, SomethingElse), SomethingElse)


"Anders Lindén" <xxxx@xxxxxx> wrote in message news:42624b12$1@xxxxxxxxxxxxxxxxxxxx
%to get the tail of the sequence

tail(sekv(D,T),T).

%find the last element:

last(nil,nil).

last(sekv(D,nil),D). %only one element left

%the recursion

last(sekv(D,R),R2):- last(tail(R,R2),R2).

Why does this recursion not work?





.