A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2000-November/010264.html below:

[Python-Dev] Re: Dynamic nested scopes

[Python-Dev] Re: Dynamic nested scopesJeremy Hylton jeremy@alum.mit.edu
Thu, 2 Nov 2000 11:36:45 -0500 (EST)
Moshe's explanation of "dynamic scope" is the definition I've seen in
every programming language text I've ever read.  The essence of the
defintion, I believe, is that a free variable is resolved in the
environment created by the current procedure call stack.

I think it muddles the discussion to use "dynamic scope" to describe
acquistion, though it is a dynamic feature.

Python using dynamic scope for exceptions.  If any exception is
raised, the exception handler that is triggered is determined by the
environment in which the procedure was called.

There are few languages that use dynamic scoping for normal name
resolution.  Many early Lisp implementations did, but I think all the
modern ones use lexical scoping instead.  It is hard to write modular
code using dynamic scope, because the behavior of a function with free
variables can not be determined by the module that defines it.  Not
saying it isn't useful, just that it makes it much harder to reason
about how a particular modular or function works in isolation from the
rest of the system.

Jeremy



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4