[erlang-questions] erlang sucks

attila.rajmund.nohl@REDACTED attila.rajmund.nohl@REDACTED
Wed Mar 12 18:29:17 CET 2008


On Tue, 11 Mar 2008, Sean Hinde wrote:
[...]
> The more normal Erlang way to write the equivalent of the C version would be 
> simply:
>
> some_function(X,Y,Z) ->
>   case handle_some_function(X,Y,Z) of
>       ok -> ok;
>       error1 -> handle_error1();
>       error2 -> handle_error2()
>   end.
>
> I'd argue that it is even more readable than the C version. And not an 'if' 
> in sight :-)

But you have to write nonsense like:
        ok -> ok;
 				Bye,NAR
-- 
"Beware of bugs in the above code; I have only proved it correct, not
  tried it."



More information about the erlang-questions mailing list