Here is my code:
is_prime(Num)->
length(list_of_dividers(Num)) == 0.
problem_7(Current, Primes, Counter) when Primes >= 10001->
Current;
pr
The reason for restricting the set of valid expressions is that evaluation of a guard expression must be guaranteed to be free of side effects. http://www.erlang.org/doc/reference_manual/expressions.html (section 7.24)
Use case
statement inside your function. You should be able to use local function in and if
case
.
Edited: Agree with @cthulahoops, I was wrong about if
http://www.erlang.org/doc/reference_manual/expressions.html#id75927