Skip to content

Commit

Permalink
Today we'll learn about disambiguation
Browse files Browse the repository at this point in the history
  • Loading branch information
zmack committed Dec 7, 2010
1 parent 957029c commit 4d6f1ac
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion first.erl
@@ -1,6 +1,6 @@
-module(first).

-export([last/1, last_two/1, item_at/2]).
-export([last/1, last_two/1, item_at/2, length/1]).

last([]) ->
empty;
Expand Down Expand Up @@ -28,3 +28,9 @@ item_at([Head|_Tail], 0) ->
Head;
item_at([_Head|Tail], Index) ->
item_at(Tail, Index - 1).

length([]) ->
0;
length([_Head|Tail]) ->
1 + first:length(Tail).

0 comments on commit 4d6f1ac

Please sign in to comment.