Question about 'if'

Marc van Woerkom Marc.Vanwoerkom@REDACTED
Tue Jun 8 12:06:12 CEST 2004


A simple question:

why is 

   if 
     f(X) =:= 42 ->
        ..
   end

not allowed, but

   Y = f(X),
   if
     Y =:= 42 ->
     ..
   end

seems to be same to me and working.
Is it to have all f() evaluations (which might show up in 
other clauses of the if again) before the if statement?

Regards,
Marc



More information about the erlang-questions mailing list