Transform a stageRunnerNode according to a functional.

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

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 })