[Python-Dev] statically nested scopes

Moshe Zadka Moshe Zadka <moshez@math.huji.ac.il>
Thu, 2 Nov 2000 10:32:11 +0200 (IST)


[Jeremy Hylton]
> ...
>     Guido once explained that his original reservation about nested
>     scopes was a reaction to their overuse in Pascal.  In large Pascal
>     programs he was familiar with, block structure was overused as an
>     organizing principle for the program, leading to hard-to-read
>     code.

[Tim Peters]
> Note that this problem will be much worse in Python:  in Pascal, you could
> always "look up" for the closest-containing func/proc that explicitly
> declares a referenced vrbl.  In Python, you have to indirectly *deduce*
> which vrbls are local to a def, by searching the entire body for an
> appearance as a binding target.  So you have to "look up" and "look down"
> from the reference point, and it's easy to miss a binding target.

This is a tool problem, and should be solved with good tools.
Of course, installing the corret tools in people's minds will require
some technological discoveries.
--
Moshe Zadka <moshez@math.huji.ac.il> -- 95855124
http://advogato.org/person/moshez