[erlang-questions] Local namespaces in case/try
Dmitry Groshev
lambdadmitry@REDACTED
Tue Jul 10 11:32:28 CEST 2012
Excuse me, Richard, but it's not an answer.
On Tuesday, July 10, 2012 1:02:29 PM UTC+4, Richard Carlsson wrote:
>
> On 07/10/2012 10:43 AM, Dmitry Groshev wrote:
> > case do_something() of
> > {ok, Result} -> Result;
> > {error, Error} -> Error
> > end,
> > case do_another() of
> > {ok, Result} -> Result;
> > {error, Error} -> Error
> > end,
> >
> > Result and Error are bound in first case and we will probably have a
> > match failure in second one. Compiler warns about this, but it's still
> > very unwieldy to fix it with names like Error1, Error2, etc.
>
> Take it as a sign that you should break out those case expressions into
> separate functions, or restructure the code in some other way.
>
> /Richard
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120710/32234f7f/attachment.htm>
More information about the erlang-questions
mailing list