[M3devel] Static chains

Tony Hosking hosking at cs.purdue.edu
Mon Jan 14 19:36:31 CET 2008


I believe Modula-3's downward-only (ie, only to callee's) exposure  
rules for procedure values will avoid this issue.

On Jan 14, 2008, at 12:19 PM, hendrik at topoi.pooq.com wrote:

> On Mon, Jan 14, 2008 at 10:47:28AM -0500, Tony Hosking wrote:
>> Rodney,
>>
>> I just realised that the static chains variables are *not* always
>> being set up for nested function internal use.  i.e., callers will
>> pass them, but nested functions that don't explicitly use them will
>> not have a static chain.  Is this something essential for you?  Why
>> would you need a static chain from within a nested function that
>> doesn't use any outer scope variables?  Since it doesn't use any
>> outer scope variables they cannot affect its execution, so debugging
>> the value of those variables seems unnecessary.  This is the default
>> behavior of gcc for static chains.
>
> And having them could break languages where it's possible to export
> procedures to places where their nonlocal procedures are still in
> existence but the intermediate lexical levels which they don't use are
> not.  (Algol 68 is a case in point)
>
> -- hendrik
>
>>
>> -- Tony
>>




More information about the M3devel mailing list