English-like Python

MRAB google at mrabarnett.plus.com
Wed Jan 21 04:16:33 CET 2009


Terry Reedy wrote:
> Joe Strout wrote:
>> 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 )
> 
> How would you differentiate
> 
> f 'abc' + 'def'
> as
> f('abc') + 'def'
> versus
> f('abc' + 'def')
> 
>> 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
> 
> LogError('walk', Time) # versus
> LogError('walk'), Time
> 
> Perhaps RB does not have tuple literals.
> 
Parentheses wouldn't be required if it's a procedure call (I'm not sure 
about a function that's called as a procedure) or if there are no 
parameters to pass. Thus:

     f 'abc' + 'def'

does:

     f('abc' + 'def')



More information about the Python-list mailing list