[erlang-questions] Newbie question about Erlang style
Kevin Scaldeferri
kevin@REDACTED
Wed Feb 27 22:27:34 CET 2008
On Feb 27, 2008, at 12:04 PM, Convey Christian J NPRI wrote:
> Is there any non-aesthetic reason prefer one of the following
> approaches over the other?
>
>
> if Foo -> X = 1;
> true -> X = 2
> end
>
> vs.
>
> X = if
> Foo -> 1;
> true -> 2
> end
A related question: are all variables function scoped in Erlang?
Obviously, the first example wouldn't work at all if the branches of
an if or case created a new scope. Is there any way to explicitly
create a new scope?
-kevin
More information about the erlang-questions
mailing list