Scope in 2.2.1

John Hall wweexxsseessssaa at telusplanet.net
Mon May 13 19:14:23 EDT 2002


On 13 May 2002 19:03:40 -0400, Kragen Sitaker <kragen at pobox.com>
wrote:

>>"they're not seen yet unless they're forward declared.
>
>Yes; unfortunately, this doesn't work in Python because Python doesn't
>have declarations, forward, backward, inside, outside, or upside down,
>except for the "global" statement.  If Python had declarations, we
>could avoid this whole mess...

Why have two-pass compilers gone out of style? Most of them are so
fast that the cost of another pass would probably be trivial, compared
to the advantages. With that, it would not need forward declarations.
Forwars declarations are more work for programmers, and might be more
work than another pass for the compiler.

(I haven't looked inside a compiler since the IBM S/360 BAL days, so
I'm speaking from ignorance.)

-- 
John W Hall <wweexxsseessssaa at telusplanet.net>
Calgary, Alberta, Canada.
"Helping People Prosper in the Information Age"



More information about the Python-list mailing list