[erlang-questions] How to make a short circuit in erlang ?
饕餮
249505968@REDACTED
Tue Mar 26 03:31:52 CET 2013
When in other language.We can use like:
example(Something){
if( Something == false)
return;
//do something here;
}
But in Erlang.I have to write like:
example(Something) ->
if
Something == false ->
false;
true ->
%do something here
end.
That's could make the multiple nested like:
example(Something) ->
if
Something == false ->
false;
true ->
if
Otherthing == false ->
false
true ->
%do something here
end.
Some code could make 5 or more nested in it.
Is there any idea to make short circuit to reduce of the nested?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130326/69347a5d/attachment.htm>
More information about the erlang-questions
mailing list