retrieveFunctionReturnTypes: Retrieve function return types

View source: R/retrieveFunctionReturnTypes.R

retrieveFunctionReturnTypesR Documentation

Retrieve function return types

Description

Retrieve the function return type definitions from an object.

Usage

retrieveFunctionReturnTypes(object_o_1)

Arguments

object_o_1

the object to consider

Value

A polymorphic return that is either

a list

as returned by the verifyObjectNames function

another list

as returned by the verifyFunctionReturnTypesDefinition function

a data.table

the function parameter types definition as declared in the source class

Author(s)

Fabien Gelineau <neonira@gmail.com>

Maintainer: Fabien Gelineau <neonira@gmail.com>

See Also

Refer to defineEvaluationModes.

Examples

##---- typical case ----
library('data.table')
source(system.file('code-samples/no-defs/Addition.R',
                   package = 'wyz.code.offensiveProgramming'))
source(system.file('code-samples/frt-defs/good/full/AdditionFI.R',
                   package = 'wyz.code.offensiveProgramming'))
retrieveFunctionReturnTypes(AdditionFI()) # works, renders a data.table
retrieveFunctionReturnTypes(Addition()) # fails, renders a list

wyz.code.offensiveProgramming documentation built on Sept. 25, 2023, 9:05 a.m.