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

Thank you, Luke, for your promptous response.

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

> Sounds like lexical scoping should work for this also -- use <<- to
> assign to the variable in the containing scope.
> 
> Best,
> 
> luke

yes, in my application, this really solves the problem. Thank you.


But I am not quite sure for the general situation:

Recall that we have the sequence of calls

myF() calls notmyG() which --with possibly more functions involved in between--
directly or indirectly calls myH().

Now, if I do not know exactly which variables are defined
in the intermediate notmyG() or in some of the functions called "in between",
I would have thought that using

VariableInMyF <<- something

within myH() bears the danger that I am overwriting
a variable of name VariableInMyF in notmyG() and "in-between's"
instead of in myF().

Or did I get something wrong?

Thanks for your help
Peter



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