From Peter.Ruckdeschel at uni-bayreuth.de  Wed Apr  4 21:25:59 2007
From: Peter.Ruckdeschel at uni-bayreuth.de (Peter Ruckdeschel)
Date: Wed, 04 Apr 2007 21:25:59 +0200
Subject: [Rd] Exchange of information between functions aside from
 argument/return-value interface
In-Reply-To: <Pine.LNX.4.64.0704041337480.17651@nokomis.stat.uiowa.edu>
References: <4613DF85.6030002@uni-bayreuth.de>
	<Pine.LNX.4.64.0704041245320.17651@nokomis.stat.uiowa.edu>
	<4613EE09.8000809@uni-bayreuth.de>
	<Pine.LNX.4.64.0704041337480.17651@nokomis.stat.uiowa.edu>
Message-ID: <4613FBC7.4020707@uni-bayreuth.de>

Thank you, Luke, once again.

>> [snipped away my original message; to be found on
>> https://stat.ethz.ch/pipermail/r-devel/2007-April/045219.html]

>> Or did I get something wrong?
> 
> I think you did. You seem to be thinking in terms of dynamic scope,
> which looks for variables in the caller and then the caller's caller.
> 
> Lexical scope addresses exactly this problem.  In lexical scope
> variable references are resolved on the basis of how function
> definitions are nested in the written code (hence the term lexical).
> If you define myH inside myF then free variables in myH are looked up
> first in myF and then in the context where myF is defined. How myH is
> called does not matter.  Nested functions in Pascal work the same way
> if that helps.

OK got it. I should have known this. I am pretty much embarrassed to
have bothered you.

Thanks again for your help
Peter



[Rd] Exchange of information between functions aside from argument/return-value interface
Peter Ruckdeschel