Parrot: Why the clunky syntax?

Martijn Faassen m.faassen at vet.uu.nl
Tue Aug 31 05:32:04 EDT 1999


Gerrit Holl <gerrit.holl at pobox.com> wrote:
> On Mon, Aug 30, 1999 at 03:49:39PM +1200, Greg Ewing wrote:
[ { } syntax versus python style indenting syntax example]
>> After all, we like Python because it does without
>> line noise like @{} -- don't we?
>> 

> What are you talking about?
> I think I missed something...

Many programming languages (such as C, C++, Perl and Java) use { and } to
mark block structure. So, instead of Python's:

if 1 == 1:
    print "We're glad 1 is still constant!"

you can write (morphed Python code -- this isn't actual C or anything):

if 1 == 1: {
    print "We're glad 1 is still constant!"
}

But here, indentation is only for readability; it doesn't have any special
meaning. So you could write this too:

if 1 == 1: { print "We're glad 1 is still constant!"
}

or whatever.

So what Greg was asking, why not use a more Pythonesque syntax for parrot,
where indentation has actual meaning?

And it's a good question. :)

Regards,

Martijn





More information about the Python-list mailing list