[erlang-questions] is there "return" in Erlang.

ok <>
Tue Mar 1 04:27:58 CET 2011


>>
> And one more option:
>
>   judge() ->
>       judge(get_a(), get_b()).
>
>   judge(A, _) when A == conf1 ->
>       do_some_thing(A);
>   judge(_, B) when B == conf2 ->
>       do_other_thing(B);
>   judge(_, _) ->
>       do_things().

This changes the control flow.  We have no reason to believe that it is even
safe to call get_b() when get_a() is CONF1.



More information about the erlang-questions mailing list