> On 16-03-2015, at 23:08, Saptarshi Guha <saptarshi.g...@gmail.com> wrote:
> 
> Hello,
> 
> I would like a function X to return to the place that called the
> function XParent that called this function X.
> 
> Y calls XParent
> Y = function(){
>  XParent()
>  print("hello")
> }
> 
> XParent calls X
> 
> XParent = function(){
>   X()
>   print("H")
> }
> 
> X returns to the point just after the call to XParent. Hence
> print("H") is not called, but instead "hello" is printed.
> 


I do not understand what you are saying or implying here.
Take this R code:

####<code>
Y <- function(){
 XParent()
 print("hello")
}

XParent <- function(){
  X()
  print("H")
}

X <- function() { print("In function X") }

Y()
####</code>

and this is the output:

[1] "In function X"
[1] "H"
[1] "hello"


Implying that everything you seem to want printed is acually printed.

Berend

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to