From lgautier at gmail.com  Mon May 26 11:00:56 2008
From: lgautier at gmail.com (Laurent Gautier)
Date: Mon, 26 May 2008 11:00:56 +0200
Subject: [Rd] value returned by findFun when the name cannot be found.
In-Reply-To: <Pine.OSX.4.64.0805241732450.723@luke-tierneys-computer-3.local>
References: <27d1e6020805241417l2e9c62a2i3710d23d50733165@mail.gmail.com>
	<Pine.OSX.4.64.0805241732450.723@luke-tierneys-computer-3.local>
Message-ID: <27d1e6020805260200x561c2a8bh5bc021e8ddf2ac04@mail.gmail.com>

2008/5/25 Luke Tierney <luke at stat.uiowa.edu>:
> On Sat, 24 May 2008, Laurent Gautier wrote:
>
>> Dear list,
>>
>> I have been using "findVar" (defined in src/main/envir.c) happily and
>> would like to use
>> "findFun".
>>
>> However I have trouble when the name searched cannot be found: while
>> "findVar" returns R_UnboundValue,
>> "findFun" does not (the 4 last lines of "findFun" are copied below).
>>
>>   error(_("could not find function \"%s\""), CHAR(PRINTNAME(symbol)));
>>   /* NOT REACHED */
>>   return R_UnboundValue;
>> }
>>
>> I assume that the comment "/* NOT REACHED */ means that R_UnboundValue
>> is not returned... and my question is:
>> what is returned then ? (I am a little lost in the nested calls within
>> "error").
>
> There is no returned -- the call to 'error' will result in a non-local
> exit (executed via longjmp).  The return statement is there to keep
> the C compiler happy since it doesn't know about this property of
> error and so would issue a warning, ant the /* NOT REACHED */ comment
> here (and elswehere) remindes us of this.



I see.
Thanks to yours answers I realize that I overlooked a comment in the C
source for "findFun", and that "findVar1" is going to be what I need.

Best,


Laurent



> Best,
>
> luke
>
>>
>>
>> Thanks,
>>
>>
>> Laurent
>>
>> ______________________________________________
>> R-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>
> --
> 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] value returned by findFun when the name cannot be found.
Laurent Gautier