[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua 5.2 and in-do-end
- From: Mark Hamburg <mark@...>
- Date: Sat, 23 Jan 2010 17:21:51 -0800
On Jan 23, 2010, at 5:13 PM, Mark Hamburg wrote:
> in-do-end really does suggest stack-based rather than function-based global scoping -- i.e., the dynamic-scoping proposal.
Specifically:
in env do
f()
end
What am I "doing"? I'm calling f. Now, if f is a global that I will now look up using env it makes some sense to say that I am calling f in env, but if f is a local then the act of calling f has pretty much nothing to do with env and the notion that I'm caling f in env is potentially misleading.
This is not an argument for dynamic scoping. That should be argued based on what it makes easier v harder, what it means as a language change, etc.
It is, however, an attempt to figure out why so many people look at in-do-end and expect what amounts to dynamic scoping.
Mark