On Thu, Feb 21, 2013 at 7:22 AM, George Shammas wrote:
The flag should be the other way around.

Most people who complain about shadowing are either new to the language or
don't understand block scoping. So why make it a flag to enable the check
when they wouldn't even to understand what the flag does without researching
Any such flag effectively creates a new dialect of the language. For
example, there are multiple dialects of C, including the language
described by the standard and the language accepted by GCC with the
-Wall -Werror options. I think we would want very compelling reasons
to split Go into multiple dialects at this point.

I agree that short declarations using :=, redeclarations using :=,
block scoping, and for and if statements introducing a new block scope
can in combination lead to situations that can be confusing. There
may be some way to improve matters. But I don't think that adding a
compiler flag is it.


You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Discussion Posts


Follow ups

Related Discussions



site design / logo © 2021 Grokbase