[erlang-questions] Erlang elseif

Dave Smith <>
Wed Nov 26 22:59:25 CET 2008


2008/11/26 Dave Smith <>

>
>
> cond
>   {ok, X} =:= f(Y) -> g(X);
>   true -> h(X)
> end
>


Again, this is exactly why I would like to avoid another conditional
construct. People would do the above when the following would be
appropriate:

case f(Y) of
  {ok, X} -> g(X);
  _ -> h(X)         %% X unbound ???
end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20081126/2e5f67f9/attachment.html>


More information about the erlang-questions mailing list