Question about 'if'
Wed Jun 9 06:40:34 CEST 2004
Marc van Woerkom wrote:
> why is
> if f(X) =:= 42 ->
> not allowed, but
> Y = f(X),
> Y =:= 42 ->
most likely it is this way to ensure that the 'if branch selection' is
done in bounded time.
assume that the choosing of a branch is done inside the virtual machine.
in your first example that means that f(X) would run to compleation,
without letting any other process run.
More information about the erlang-questions