Python's Lisp heritage

Tim Peters tim.one at comcast.net
Tue Apr 23 22:03:11 EDT 2002


[James J. Besemer]
> ...
> The original semantics (as formally defined in Lisp itself
> [McCarthy]) called for dynamic binding.

It seems this would have been a surprise to McCarthy <wink>:

    http://www-formal.stanford.edu/jmc/history/lisp/node4.html

See paragraph "d. Free variables".  When a user bumped into a function where
the difference between dynamic and lexical scoping mattered, and lexical
scoping was what they needed, "I must confess that I regarded this
difficulty as just a bug".  The understanding of these issues was much
muddier at the time.

> ...
> I find it highly ironic that Perl originally did it the wrong way
> ("local"), although later they introduced a now-recommended static
> binding ("my").

More recently, REBOL went down the same path.  Dynamic scoping is attractive
for implementation reasons; everyone who succumbs eventually regrets it
(except for RMS in elisp ...).






More information about the Python-list mailing list