[erlang-questions] case expression scope

Thomas Lindgren thomasl_erlang@REDACTED
Wed Mar 5 15:33:42 CET 2014


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.
>> 
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140305/3c70f12b/attachment.htm>


More information about the erlang-questions mailing list