list-length.pl 129 B

123
  1. lengthof(L, 0) :- L == [].
  2. lengthof([_|R], NewLength) :- lengthof(R,Length),
  3. NewLength is Length+1.