typeInfo: Get or set type information for a function.

Description Usage Arguments Value Author(s) References See Also

View source: R/support.S

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

1
2
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.

Author(s)

Duncan Temple Lang <duncan@wald.ucdavis.edu>

References

http://www.omegahat.org/OptionalTyping

See Also

checkArgs checkReturnValue


TypeInfo documentation built on Nov. 8, 2020, 5:40 p.m.