Python scoping

Alex Martelli aleaxit at yahoo.com
Thu Oct 26 18:28:15 EDT 2000


"Steven D. Majewski" <sdm7g at virginia.edu> wrote in message
news:mailman.972589295.8493.python-list at python.org...
    [snip]
> in those cases, even with a block delimiter, I find I need to use
> additional comments: 'endif' isn't enough because I probably have
> multiple if statements, so I need "endif (test-condition)" to match
> up with "if (test-condition)".
>  I don't know of any programming languages that are quite that verbose,

There are languages that let you name blocks, and I believe
I recall that in PL/I you may, if you wish, recall the label in
the END clause (or was it Ada...?  darn -- big languages, long
ago...):
    Foo: BEGIN
        /* whatever */
    END Foo;

> and I'm not sure I would like it since the shorter one-page cases
> vastly prevail, so I might as well use comments for those exceptional
> cases. ( And it's not any harder to use comments with "offside rule"
> block structure than it is with explicit end tokens. )

The naming (in that too-big language) was optional, but, if
present, it was checked so that block-closure errors could be
more precisely diagnosed.


Alex






More information about the Python-list mailing list