[Rd] value returned by findFun when the name cannot be found.

Laurent Gautier lgautier at gmail.com
Mon May 26 11:00:56 CEST 2008


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
>



More information about the R-devel mailing list