On 2/21/11 11:11 PM, Steven W. Orr wrote:
> It has been an exciting weekend for me. I studied the dynamic vs static
> scoping rules and I think I have a better handle on things, but I have a
> few questions.
>
> It seems that there's no reason why we are not allowed to write nested
> functions. Nested functions would not be visible to other functions, and
> might be a way of providing capabilities to users to specify *when* they
> want to have static scoping.
You already can write nested functions, and those functions are not
declared until their `containing' function is called. They just have
global scope, since there's no mechanism to declare a local function.
Any extension to restrict functions to local scope would have to be
backwards compatible with that.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU [email protected] http://cnswww.cns.cwru.edu/~chet/