[erlang-questions] conditional expressions

mats cronqvist masse@REDACTED
Sat Nov 15 18:42:53 CET 2008


Richard Carlsson <richardc@REDACTED> writes:

>
> X = case foo() of
>        [] -> bar();
>        X1 -> X1
>      end

  strangely, this also works;

case foo() of
  [] -> X = bar();
  X -> ok
end

  as long as X is bound in each clause, you're golden.

  this might qualify as a gotcha.

  mats



More information about the erlang-questions mailing list