bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Patterns of dynamic scoping and nested routines.


From: Chet Ramey
Subject: Re: Patterns of dynamic scoping and nested routines.
Date: Tue, 22 Feb 2011 09:47:23 -0500
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7

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    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]