matchFunctionSignature: Retrieve Function Arguments.

Description Usage Arguments Details Value Author(s) Examples

View source: R/matchFunctionSignature.R

Description

Use method matchFunctionSignature to match a function signature.

Usage

1
matchFunctionSignature(aFunction_f_1, aFunctionTemplate_f_1 = function(){})

Arguments

aFunction_f_1

a function or primitive. Not a string!

aFunctionTemplate_f_1

a function or primitive to be used as model. Not a string!

Details

To get TRUE as result, function and function model must share exactly the sames attributes names and values, including default values if any used.

Value

A boolean value.

Author(s)

Fabien Gelineau <neonira@gmail.com>

Maintainer: Fabien Gelineau <neonira@gmail.com>

Examples

1
2
3
4
5
matchFunctionSignature(sum, function(..., na.rm = FALSE) { NULL })
# [1] TRUE

matchFunctionSignature(sum, function(..., na.rm) { NULL })
#[1] FALSE

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