This function is the counterpart to
in the type validation for an R function.
When called, either implicitly or explicitly when the function
returns, it attempts to determine whether the value being
returned by the function call is valid relative
to the type information of the function and the call itself.
Specifically, it uses the signature of the current call to the
function if it is available (returned by
to see if it has a specified return type. If so,
it compares the return value to that.
Otherwise, it checks to see if the return type for the
overall type info object (not just the specific type signature
for the call) is specified and then uses that to validate the
type. If neither is specified, then the value is not validated
and the value returned.
the specifiedtype of the return value.
this is a very special value which is a call to
return the value of
the signature corresponding to the call of the function
the function object whose return value is to be validated.
It is from this that we get the type info via
If the validation takes place and is successful
or simply doesn't take place because no
available, the return value is
Otherwise, if the validation fails, an error is raised.
This is a prototype to illustrate the idea. It might be done in C code in the future within the R interpreter.
Duncan Temple Lang <[email protected]>
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.