/*
	?- listing(last).
	lists:last([B|A], C) :-
		last_(A, B, C).
	
	true.
	
	?- listing(last_).
	lists:last_([], A, A).
	lists:last_([B|A], _, C) :-
		last_(A, B, C).
	
	true.
*/

mylast([B|A], C) :- mylast_(A, B, C).

mylast_([], A, A).
mylast_([B|A], _, C) :- mylast_(A, B, C).

mylast_cl(B:A, C) :- mylast_cl_(A, B, C).

mylast_cl_(empty, A, A).
mylast_cl_(B:A, _, C) :- mylast_cl_(A, B, C).

