fork(4) download
  1. my_length([],0).
  2. my_length([_|L],N) :- my_length(L,N1), N is N1 + 1.
  3.  
  4. my_length_lol([], 0).
  5. my_length_lol([H|L],N) :- my_length(H,Add), my_length_lol(L,N1), N is N1 + Add.
  6.  
  7.  
  8. :- my_length_lol([[quick], [brown, fox], [jumps, over, the], [lazy, dog]], X), writeln(X).
Success #stdin #stdout #stderr 0.02s 6204KB
stdin
Standard input is empty
stdout
8
stderr