Python & Go
mensanator at aol.com
Thu Nov 12 08:01:59 CET 2009
On Nov 12, 12:44�am, geremy condra <debat... at gmail.com> wrote:
> On Thu, Nov 12, 2009 at 12:27 AM, Mensanator <mensana... at aol.com> wrote:
> > On Nov 11, 9:56�pm, geremy condra <debat... at gmail.com> wrote:
> >> On Wed, Nov 11, 2009 at 9:00 PM, Mensanator <mensana... at aol.com> wrote:
> >> > On Nov 11, 6:53�pm, kj <no.em... at please.post> wrote:
> >> >> I'm just learning about Google's latest: the GO (Go?) language.
> >> >> (e.g.http://golang.orgorhttp://www.youtube.com/watch?v=rKnDgT73v8s).
> >> >> There are some distinctly Pythonoid features to the syntax, such
> >> >> as "import this_or_that",
> >> > There's more to Python than import statements.
> >> > In fact, this Go language is nothing like Python.
> >> Actually, numerous analogies have been drawn between the two
> >> both by whoever wrote the docs and the tech media, including
> >> slashdot and techcrunch.
> >> >> the absence of parentheses at the top of
> >> >> flow control constructs,
> >> > Huh?
> >> The OP is referring to the fact that for and if do not have
> >> mandatory parenthesis.
> >> >> and quite a few statements without a
> >> >> trailing semicolon.
> >> > Those are exceptions, the rule appears to be "ends with semicolon".
> >> > In this example, I see semicolons all over the place.
> >> The rule is that if its between parens, it needs semicolons.
> >> <snip>
> > Why did you snip the example that proves you're wrong?
> For the very simple reason that I'm not. From the roughly
> 20 minute tutorial:
> "Semicolons aren't needed here; in fact, semicolons are unnecessary
> after any top-level declaration, although they are needed as
> separators within a parenthesized list of declarations."
> In fact, you can clearly see this in action even in the example
> you posted- there is no semicolon after the import, nor is one
> required after any initialization or where line endings are
So, where line endings ARE ambiguous requires
semicolons. The above statement may be true for
top-level statements, but not within blocks, as
the example clearly shows. The lines were NOT
within parens, yet had trailing semicolons.
You're still wrong.
> such as immediately preceding the end of a
> Geremy Condra
More information about the Python-list