Learn R Programming

tailr (version 0.1.3)

loop_transform: Transform a function from recursive to looping.

Description

Since this function needs to handle recursive functions, it needs to know the name of its input function, so this must be provided as a bare symbol.

Usage

loop_transform(fun, byte_compile = TRUE, set_srcref = TRUE)

Arguments

fun

The function to transform. Must be provided as a bare name.

byte_compile

Flag specifying whether to compile the function after transformation.

set_srcref

Flag specifying whether the "srcref" attribute should be set to the original value. If you do this, you can print the modified function and it will look like the original, but printing it will not show the actual, tranformed, source.