While everyone is saying what they want in Python :)

Daniel Dittmar daniel.dittmar at sap.com
Tue Feb 6 11:46:15 EST 2001


In VB, although WITH can be nested, only the innermost is valid. Together
with the .dot notation makes your intentions pretty explicit. In Pascal, you
have
- nested with
- multiple expressions allowed in the with clause
- no dots
which leads to very messy code.

Although cascading in Smalltalk and with in VB are very different, in most
cases, they lead to similar code (Pythonified):

sys.stdout
    .write (...);
    .write (...);
    .write (...)

with sys.stdout:
    .write (...);
    .write (...);
    .write (...)

The main exception is object creation, where in Smalltalk, you can create an
object and send it a bunch of cascaded initialization messages.

One problem with cascading is that I don't know yet of a syntax using
indentation. And using ';' as a delimiter? There are already far too many
people writing 'if <cond>: thenstmt', all in one line.

Daniel

--
Daniel Dittmar
daniel.dittmar at sap.com
SAP DB, SAP Labs Berlin
http://www.sapdb.org/






More information about the Python-list mailing list