Python as an Object Oriented Programming Language

maney at pobox.com maney at pobox.com
Thu Dec 19 11:08:17 EST 2002


Roy Smith <roy at panix.com> wrote:
> By that kind of logic, *all* flow control statements can be thought of 
> as combinations of ifs and gotos.

Well, yes, of course they can.  After all, at a certain level they
*are* just stylized patterns of use of conditional branches.  Knuth's
1974 article "Structured Programming with Goto Statements" is a
fascinating exploration of some well-defined structures that aren't
usually available, but certainly could be.  Of course the motivation
for the exercise is efficency in a fairly small scale, but the lesson
is much more general.  :-)

> The difference between goto and break is that break is very limited in 
> where you can go to, namely the first statement after the immediately 
> enclosing block (I hope I said that in a way that satifies language 
> laywers).  So, if you're looking at a piece of code and think to 
> yourself, "how could I get here?", the scope of places to look is 
> limited to the immediately preceeding statement block.  If you're 

Yep.  Consider, if you like, the parallels behind this constaint and
Python's macrolessness.  Hey, I only favor untangled exposition in
code, not usenet threads!



More information about the Python-list mailing list