Wednesday, 23 September 2009

recursively strip head element from list

   1:  -module(play).
   2:  -export([headstrip/1]).
   3:   
   4:  headstrip([]) -> ok;
   5:  headstrip([HeadRest]) -> 
   6:      io:format("~w~n",[Head]),
   7:      headstrip(Rest).

No comments: