[Python-Dev] Re: anonymous blocks

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Apr 29 06:51:56 CEST 2005

Shane Hathaway wrote:

> "Block statements provide a mechanism for encapsulating patterns of
> structure.  Code inside the block statement runs under the control of an
> object called a block iterator.  Simple block iterators execute code
> before and after the code inside the block statement.  Block iterators
> also have the opportunity to execute the controlled code more than once
> (or not at all), catch exceptions, or receive data from the body of the
> block statement.

That actually looks pretty reasonable.

Hmmm. "Patterns of structure." Maybe we could call it a
"struct" statement.

    struct opening(foo) as f:

Then we could confuse both C *and* Ruby programmers at
the same time! :-)

[No, I don't really mean this. I actually prefer "block"
to this.]

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg.ewing at canterbury.ac.nz	   +--------------------------------------+

More information about the Python-Dev mailing list