FAQ
A "var oa int" would still be in block scope.

On Thu, Feb 21, 2013 at 2:58 PM, Jan Mercl wrote:

On Thu, Feb 21, 2013 at 2:38 PM, Patrick Mylund Nielsen
wrote:
I would propose another radical solution for this: Simply that
shadowing
variables is not allowed.
Good bye block scoping.
Block scoping does not disappear if you can't declare new variables with
names identical to variables in outer scopes.
package main
var a int
func main() {
var a int // main.go:4: a redeclared in this block previous
declaration at main.go:2

...
}

Well, is it just me who doesn't call the above 'block scoping' anymore?

-j
--
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

Previous

Follow ups

Related Discussions

People

Translate

site design / logo © 2021 Grokbase