Re: Why do some people shun `if`?
Vance Shipley <[email protected]>
| Newsgroups | gmane.comp.lang.erlang.general |
|---|---|
| Message-ID | <CAMoa0N+=SiPBSWpTpWb55ay=MeyrFeUBJUAc7C0j73+7DRcMEg@mail.gmail.com> |
Why I find 'if' awkward is that when I test a condition for the success
path and have a fall through clause for the fail path the semantics don't
match with 'true'.
if
Foo == 42 ->
ok;
true ->
{error, Foo}
end.
--
-Vance