insertReturn: Insert explicit calls to 'return'

Description Usage Arguments Value Author(s) See Also Examples

Description

This function modifies an R function or expression to insert explicit calls to return in appropriate places in the expressions.

Usage

1
insertReturn(expr, nested = FALSE, ...)

Arguments

expr

the function or expression to be potentially modified

nested

a logical value that controls whether we explicitly wrap a call within a return call.

...

additional parameters for methods such as the compiler object

Value

The original object expr which is potentially modified.

Author(s)

DTL

See Also

compileFunction

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
f = function(x)  x + 1
insertReturn(f)

f = function(x) {
      if(x < 0)
         -x
      else
         10* xn
    }

insertReturn(f)

duncantl/RLLVMCompile documentation built on May 15, 2019, 5:31 p.m.