[erlang-questions] Newbie question about Erlang style
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
> X = if
> Foo -> 1;
> true -> 2
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?
More information about the erlang-questions