Stackoverflow -ers elements,
I am currently studying Erlang. Can someone point me to why I get illegal guard expressionwith this guard?
add_new_prime(Idx, Primes, Ref) when length(Primes) =:= 0 ; math:sqrt(Idx) < hd(Primes) -> Ref ++ [Idx];
If I "donβt optimize" it, doing only add_new_prime(Idx, Primes, Ref) when length(Primes) =:= 0 -> Ref ++ [Idx];
it works. I saw several examples in which there are several expressions, but it is not clear why my work does not work.
Thank you so much!
source
share