Skip to content
Prev 325875 / 398502 Next

Lexical scoping is not what I expect

On Mon, Jun 24, 2013 at 4:27 PM, David Kulp <dkulp at fiksu.com> wrote:
What you have described is called dynamic scoping. What lexical
scoping is is that it resolves free variables based on where the
function is _defined_, not where it is run and it has nothing to do
with the call stack.  a is a free variable in g and so when g is run R
looks up a in the environment where g was defined which is the global
environment and there is no a there.

--
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com

Thread (27 messages)

David Kulp Lexical scoping is not what I expect Jun 24 Rui Barradas Lexical scoping is not what I expect Jun 24 Gabor Grothendieck Lexical scoping is not what I expect Jun 24 arun Lexical scoping is not what I expect Jun 24 Rolf Turner Lexical scoping is not what I expect Jun 24 Marc Schwartz Lexical scoping is not what I expect Jun 24 Duncan Murdoch Lexical scoping is not what I expect Jun 24 David Kulp Lexical scoping is not what I expect Jun 24 William Dunlap Lexical scoping is not what I expect Jun 24 Duncan Murdoch Lexical scoping is not what I expect Jun 25 S Ellison Lexical scoping is not what I expect Jun 26 Duncan Murdoch Lexical scoping is not what I expect Jun 26 Hadley Wickham Lexical scoping is not what I expect Jun 27 S Ellison Lexical scoping is not what I expect Jun 28 Duncan Murdoch Lexical scoping is not what I expect Jun 28 John Fox Lexical scoping is not what I expect Jun 28 Duncan Murdoch Lexical scoping is not what I expect Jun 28 Brian Ripley Lexical scoping is not what I expect Jun 28 John Fox Lexical scoping is not what I expect Jun 28 John Fox Lexical scoping is not what I expect Jun 28 Rolf Turner Lexical scoping is not what I expect Jun 28 Yihui Xie Lexical scoping is not what I expect Jun 28 William Dunlap Lexical scoping is not what I expect Jun 29 Greg Snow Lexical scoping is not what I expect Jun 29 Rolf Turner Lexical scoping is not what I expect Jun 30 Duncan Murdoch Lexical scoping is not what I expect Jun 30 David Winsemius Lexical scoping is not what I expect Jun 30