English-like Python

Joe Strout joe at strout.net
Tue Jan 20 13:58:46 EST 2009


Aaron Brady wrote:

> I think it would be a good step if you could make some sensible
> interpretation of a typical statement without its parentheses.
> 
> f "abc" 123
> -->
> f( "abc", 123 )
> 
> It would be just the thing in a couple of situations...

Such a language is possible -- take a look at REALbasic sometime.  RB 
certainly has its problems (mainly bugs), but the language syntax is 
beautiful.  To your point, parentheses are not required around any 
method call that (1) has no return value, or (2) requires no parameters. 
  Example:

  LogError "Walk has gotten too silly", CurrentTime

Here, LogError is a method call that takes two arguments, and 
CurrentTime is a method call that takes none.

Your "f" example above works fine in RB too, though with such an 
abstract example it's a little hard to see why it's so cool.

Eliminating unnecessary parentheses does a lot to improve the 
readability of the code IMHO.

Cheers,
- Joe




More information about the Python-list mailing list