Executing boolean expressions on a list
Fri Mar 14 11:01:28 CET 2003
spearce> recursive(N, [H | T]) -> somef(N, H) and recursive(N,
spearce> recursive(N, ) -> true.
spearce> but was worried about order of evaluation on the and operator
spearce> and not being able tail-recursive.
recursive(N, [H | T]) -> somef(N, H) andalso recursive(N, T);
recursive(N, ) -> true.
This variant would be the right answer. `andalso' calculates it's right
part only if the left is true (as in C,Perl, etc).
More information about the erlang-questions