Skip to content

Instantly share code, notes, and snippets.

@johnmyleswhite
Created February 3, 2014 23:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnmyleswhite/8794783 to your computer and use it in GitHub Desktop.
Save johnmyleswhite/8794783 to your computer and use it in GitHub Desktop.
Scope reification in R
foo <- function(frame_number)
{
assign("frame_number", -1, envir = sys.frame(frame_number))
}
bar <- function()
{
frame_number <- sys.nframe()
print(frame_number)
foo(frame_number)
print(frame_number)
}
bar()
@cscheid
Copy link

cscheid commented Feb 3, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment