What is the difference between parent.frame() and parent.env() in R; how do they differ in call by reference?

parent.env is the environment in which a closure (e.g., function) is defined. parent.frame is the environment from which the closure was invoked. f = function() c(f=environment(), defined_in=parent.env(environment()), called_from=parent.frame()) g = function() c(g=environment(), f()) and then > g() $g <environment: 0x14060e8> $f <environment: 0x1405f28> $defined_in <environment: R_GlobalEnv> $called_from <environment: 0x14060e8> I’m not sure when a mere … Read more

Trying to understand gcc option -fomit-frame-pointer

Most smaller functions don’t need a frame pointer – larger functions MAY need one. It’s really about how well the compiler manages to track how the stack is used, and where things are on the stack (local variables, arguments passed to the current function and arguments being prepared for a function about to be called). … Read more