removeAfterReturn | R Documentation |
return
callThis function removes dead code that cannot possible be reached by the
interpreter because it comes after an explicit call to return
.
One of the purposes of this function is to merely clean and simplify
code. We use it to remove extraneous code before compiling R code
in the RLLVMCompile
package.
removeAfterReturn(fun, recurse = TRUE)
fun |
the function whose code we analyze and clean, or an
expression or call, i.e. a |
recurse |
a logical value that controls whether we recursively
process each expression or just process the top-level expressions in |
The modified version of the function with any extraneous code in the body removed.
Duncan Temple Lang
removeConstIf
f =
function(x) {
print(x)
return(x + 1)
length(x)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.