R/dev/parent_frames_in_s4.r

setGeneric(
  name = "foo",
  signature = c(
    "input"
  ),
  def = function(
    input = NULL,
    id = character(),
    value = NULL,
    where = parent.frame(), ## TODO: verify this!!!
    ...
  ) {
    standardGeneric("foo")       
  }
)
setMethod(
  f = "foo", 
  signature = signature(
    input = "missing"
  ), 
  definition = function(
    input,
    value,
    where,
    ...
  ) {
  
  print(ls(where))
    
  }
)
foo()
rappster/reactr documentation built on May 26, 2019, 11:56 p.m.