From luke at stat.uiowa.edu  Thu Aug 16 22:26:38 2007
From: luke at stat.uiowa.edu (Luke Tierney)
Date: Thu, 16 Aug 2007 15:26:38 -0500 (CDT)
Subject: [Rd] methods and try() [R-devel]
In-Reply-To: <7098abec0708161253l4b437f37l380c529d1fd4c558@mail.gmail.com>
References: <7098abec0708152232s6d9fbb2ewb76cfa2cd4d7b1b2@mail.gmail.com> 
	<Pine.LNX.4.64.0708160742020.2550@itasca2.wildberry.org>
	<7098abec0708161253l4b437f37l380c529d1fd4c558@mail.gmail.com>
Message-ID: <Pine.LNX.4.64.0708161525100.2836@itasca2.wildberry.org>

On Thu, 16 Aug 2007, Byron Ellis wrote:

> On 8/16/07, Luke Tierney <luke at stat.uiowa.edu> wrote:
>> On Wed, 15 Aug 2007, Byron Ellis wrote:
>>
>>> Hi all, I'm having a problem with some sort of interaction with try()
>>> and methods, I think.
>>>
>>> The setup is as follows, I have an S4 class that holds an environment
>>> and I would like to evaluate the right hand side of a function inside
>>> that environment. No problem there.
>>>
>>> However, if the formula involves a symbol that doesn't exist, which
>>> may or may not happen, it fails as it should and reports and error
>>> "blah blah does not exist." As it should.
>>>
>>> When I wrap that same call in a try() statement, the error becomes "no
>>> function to return from, jumping to top level," bypassing the try
>>> statement and generally wreaking havoc. Any clues what might be
>>> causing this?
>>
>> Yes.  There is no context on the stack that corresponds to the
>> environment to which a jump is to be made.  Why that is the case is
>> impossible to tell without a simple reproducible example.
>
> I have a sinking feeling that generating a good reduction will also
> find my bug. :-) I was mostly wondering if there had been a recent
> change in the try() machinery. In any case, I'll keep hunting for the
> problem.

There sae, at 2.5.0 I believe.  At that point try was reimplemented in
terms of tryCatch.  That may have uncovered a bug in our code or
yours, but without a reproducible example it's hard to say more.

Best,

luke


>
>>
>> Best,
>>
>> luke
>>
>>
>> --
>> Luke Tierney
>> Chair, Statistics and Actuarial Science
>> Ralph E. Wareham Professor of Mathematical Sciences
>> University of Iowa                  Phone:             319-335-3386
>> Department of Statistics and        Fax:               319-335-3017
>>     Actuarial Science
>> 241 Schaeffer Hall                  email:      luke at stat.uiowa.edu
>> Iowa City, IA 52242                 WWW:  http://www.stat.uiowa.edu
>>
>
>
>

-- 
Luke Tierney
Chair, Statistics and Actuarial Science
Ralph E. Wareham Professor of Mathematical Sciences
University of Iowa                  Phone:             319-335-3386
Department of Statistics and        Fax:               319-335-3017
    Actuarial Science
241 Schaeffer Hall                  email:      luke at stat.uiowa.edu
Iowa City, IA 52242                 WWW:  http://www.stat.uiowa.edu



[Rd] methods and try() [R-devel]
Luke Tierney