Todo.md

To Fix

source("~/Books/NextLevelComputationalReasoning/ExploreCode/Variety_trial_analysis/code/uc_ipm_funs.R")
getGlobals(get_stn_info, indirectCallFunctions = names(CodeAnalysis:::getIndirectCallFunList(xpathSApply = "fun", xpathApply = "fun")))

New Features/Functionality

Done

listWriteDataFuns( myWrite = c("a", "b"))
p = new('externalptr')
f = function() return(x)
body(f)[[2]] = p
getGlobals(f)

g = function() { if(x < 0)  y else p}
body(g)[[2]][[4]] = p
getGlobals(g)

g = function(a = 1) { if(x < 0)  y else p}
formals(g)$a = p
getGlobals(g)
In procIndirectFunCall(e, funName) :
       cannot currently determine function in empty call to match.call. That uses the context of the call.1

getFunctionDefs v findFunctionDefs

findFunctionDefs picks up x$fun = function which is not necessarily good

z = getFunctionDefs("getFunctionDefsEg2.R") # file
z3 = getFunctionDefs(".")   # directory
e = new.env(); source("getFunctionDefsEg2.R", e); ze = getFunctionDefs(e)  # environment
z4 = getFunctionDefs(as.list.environment(e, TRUE)) # list
getFunctionDefs(z4$rec) # function object
getFunctionDefs(quote(function(x)  x + 1)) # call
getFunctionDefs(quote(x <- function(x)  x + 1))  # assignment call

z = getFunctionDefs("getFunctionDefsEg2.R", recursive = TRUE)
e = parse("getFunctionDefsEg2.R")
z2 = getFunctionDefs(e)
z2r = getFunctionDefs(e, recursive = TRUE)




duncantl/CodeAnalysis documentation built on April 28, 2024, 6:01 p.m.