[erlang-questions] How to put a guard? Solved!

Jilani Khaldi jilani@REDACTED
Sat Aug 11 21:20:42 CEST 2007

igwan wrote:
> Hello,
>> %tail recursion
>> pos2(X, L) -> position(X, L, 0).
>> position(X, [X|_], N) -> 1+N;
>> position(X, [_|T], N) -> mypos(X, T, 1+N).
 >>Where does mypos/3 come from ?

Sorry, it is "position(X, T, 1+N).".
The question has been solved, thank you.


More information about the erlang-questions mailing list