johnwahba / go-tour

Automatically exported from code.google.com/p/go-tour
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

if: parentheses _are_ optional #52

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
While translating the Go Tour to Spanish, I found this error:
- The "if" slide says that parentheses "are not even optional".

This is true for the "for" statement, but not for the "if" statement, since an 
expression can have outer parentheses (and any number of them), even if they 
are not considered to be part of the "if" statement.

In a way, I suppose it is true that the "if" statement doesn't have 
parentheses, but from the viewpoint of someone learning the language, the "are 
not even optional" sentence is misleading.

I think this would affect somewhat the "Sound familiar?" at the end, since it 
suggests that "for" and "if" are identical in that respect.

Original issue reported on code.google.com by pau.du...@gmail.com on 20 Dec 2012 at 11:20

GoogleCodeExporter commented 9 years ago
I agree.

Original comment by a...@golang.org on 14 Jan 2013 at 3:01

GoogleCodeExporter commented 9 years ago
This issue was closed by revision b32ba9b8d870.

Original comment by a...@golang.org on 2 Jul 2013 at 10:29