[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Lexical and dynamic scoping (was Re: Redefining locals)
- From: Mark Hamburg <mhamburg@...>
- Date: Thu, 11 Nov 2004 08:45:47 -0800
Dynamic scoping looks for variable definitions by looking up the call stack.
Lua does not do this. The original version of LISP does this.
Lexical scoping looks for variables by looking through the lexical nesting
in the source code. Lua and Scheme do this.
I was going to describe PostScript as doing dynamic scoping, but what it
really does is look things up in the dictionary stack which could be
emulated in Lua through proper manipulation of the global environment.
Mark