TypeInfo (version 1.38.0)

typeInfo: Get or set type information for a function.

Description

These functions provide controlled access to type information for a function. They encapsulate the way the information is stored for the function (although it is trivial to find out how it is done and where the information is)

Usage

typeInfo(func) "typeInfo<-"(func, rewrite = TRUE, value)

Arguments

func
the function whose type information is to be accessed
rewrite
a logical value. This controls whether the body of the function func is rewritten so that checks for the arguments and return type are added to the code and the appropriate actions are taken when the function returns control to the caller. This is necessary to get calls to return in the function to behave correctly and allow the return value to be validated.
value
an object of class TypeSpecification-class

Value

typeInfo returns the type information associated with the function. typeInfo<- returns the modified function.

References

http://www.omegahat.org/OptionalTyping

See Also

checkArgs checkReturnValue