Named code blockes

Miki Tebeka tebeka at lycosmail.com
Sat Apr 14 11:12:29 EDT 2001


Hello Alex,

>...
> and your specific example is pretty mysterious to me --
> the purpose of the outer 'while1' escapes me
Just for the sake of example, didn't find anything smarter.


> Actually, named-continue I see as definitely dispensable
> , but named-break would be useful.
Why? As I see it, if you want named break you'll want named continue.

> In Python, you can code around this problem in various ways (besides
> the classic ideas based on using state-flags to let the inner loop tell
the
> outer one it must terminate).  try/except is a very powerful building
> block for all sorts of "get out of this nested construct" call, for
example;
> it also works across function calls, even recursive ones (its very power
> and generality can make it less immediately clear than a more local
> named-break would be, of course).
If these are code-around then we agree that there is a problem there.
I agree with these technique, however try/except have a relatively high
performance impact comparing to a simple implementation of named-break which
will be a goto in c.


Bye.
----------------------------------------------------------------------------
--
Smile, damn it, smile.

lambda msg:

 'name' : 'Miki Tebeka',
 'email' : 'tebeka at lycosmail.com',
 'homepage' : 'www.tebeka.freeservers.com',
 'quote' : "I don't suffer from insanity, I enjoy every minute of it."
}[msg]






More information about the Python-list mailing list