retrieveFunctionReturnTypes: Retrieve function return types

Description Usage Arguments Value Author(s) See Also Examples

View source: R/retrieveFunctionReturnTypes.R

Description

From an instrumented class, retrieve the function return types definition.

Usage

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

1
2
3
4
5
6
7
8
##---- 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

neonira/wyz.code.offensiveProgramming documentation built on Feb. 20, 2020, 2:01 p.m.