sandbox/pe/heads.erl

15 lines
160 B
Erlang
Raw Normal View History

2019-04-22 02:25:01 +00:00
-module(heads).
-export([len/1]).
alen([], Count) ->
Count;
alen([_|T], Count) ->
alen(T, Count+1).
len([_|T]) ->
alen(T, 1);
len([]) ->
0.