Skip to content
Back to formatted view

Raw Message

Message-ID: <6eb05719add6861cc72c25a41f432622@fhcrc.org>
Date: 2005-03-02T07:21:44Z
From: Seth Falcon
Subject: return from nested function?
In-Reply-To: <20050225203420.F1681AEA30@mail.rsma.frb.gov>

On Feb 25, 2005, at 12:34 PM, jhallman at frb.gov wrote:

> Is is possible from within a function to cause its caller to return()?

This snippet may be of interest:


 > f = function(x) {
+ print("f")
+ g(return())
+ print("end of f")
+ }

 > g=function(x) {print("g")
+ x
+ print("end of g")
+ }

 > f(1)
[1] "f"
[1] "g"
NULL