[erlang-questions] case expression scope

Anthony Ramine n.oxyde@REDACTED
Wed Mar 5 15:39:01 CET 2014


What would you like to be warned about? I don’t get it.

-- 
Anthony Ramine

Le 5 mars 2014 à 15:33, Thomas Lindgren <thomasl_erlang@REDACTED> a écrit :

> Thanks Anthony, that option warns for Value in the previous example because it's exported from the case, but not for the variable match that then occurs. I'd like to see a compiler option that warned about matching (bound variables occurring in patterns), which would catch other inadvertent reuse of variable names.
> 
> Best,
> Thomas
> 
> 
> On Wednesday, March 5, 2014 2:40 PM, Anthony Ramine <n.oxyde@REDACTED> wrote:
> The compile option is warn_export_vars:
> 
>     Causes warnings to be emitted for all implicitly exported variables referred to after the primitives where they were first defined. No warnings for exported variables unless they are referred to in some pattern, which is the default, can be selected by the option nowarn_export_vars.
> 
> -- 
> Anthony Ramine
> 
> Le 5 mars 2014 à 12:18, Thomas Lindgren <thomasl_erlang@REDACTED> a écrit :
> 
> > In the larger scheme of things: The way I see it, the feature of implicit variable matching is more trouble than it's worth. Warnings about such matches would catch this kind of problems.
> > 
> 
> 




More information about the erlang-questions mailing list