Proposed PEP for a Conditional Expression

Markus Schaber markus at schabi.de
Mon Sep 17 11:21:03 EDT 2001


Hi,

Marcin 'Qrczak' Kowalczyk <qrczak at knm.org.pl> schrub:

>> ps.  Then attention could be focused on defining a mechanism for
>> general-purpose, unnamed, "in-place" code blocks.  If we had such,
>> we could then create many convenient idioms using functions and
>> methods -- instead of constantly wrangling with new syntactic forms
>> and keywords.
> 
> Yes, but the syntax of explicitly creating such block would be a bit
> annoying if they would have to be created for e.g. loops.

I just remembered my steps in TCL. There, even loops are commands which 
get some unnamed code blocks as arguments (the condition and the body).

Maybe we could do the same, based on indentation instead of {}s.

But I see some problems in handling the if: else: this way, there the 
else: command needs to know the result of the corresponding if: 
command. 

markus
-- 
"The strength of the Constitution lies entirely in the determination of 
each citizen to defend it. Only if every single citizen feels duty 
bound to do his share in this defense are the constitutional rights 
secure." -- Albert Einstein



More information about the Python-list mailing list