stageRunnerNode_transform: Transform a stageRunnerNode according to a functional.

Description Usage Arguments Value Examples

Description

Transform a stageRunnerNode according to a functional.

Usage

1
stageRunnerNode_transform(transformation)

Arguments

transformation

function. An arity-1 function which takes the callable of a stageRunnerNode and transforms it into another callable (i.e. a function or a stagerunner). If the original callable is a stagerunner, its terminal nodes in turn will be transformed recursively.

Value

The transformed callable.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
increment <- 1
adder     <- function(x) x + increment
node      <- stageRunnerNode$new(function(e) print(adder(1)))
node$transform(function(fn) {
  environment(fn)$increment <- environment(fn)$increment + 1; fn
})
node$run() # Prints 3, rather than 2

## End(Not run)

syberia/stagerunner documentation built on May 30, 2019, 10:41 p.m.