-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Description
For example:
library(S7)
type <- new_generic("type", "x")
data <- new_class("data")
method(type, data) <- function(x) {
typeof(x)
}
object <- data()
type(object)We'd like to be able to set a breakpoint inside the body of the defined function using trace(). I think we'd do this with something like:
trace(data, where = type@methods)but this fails with
> trace("data", where = type@methods)
c("Constructing traceable class \"S7_methodWithTrace\"", "Constructing traceable class \"functionWithTrace\"", "Constructing traceable class \"S7_objectWithTrace\"")
c("Environment of class \"S7_method\" is locked; using global environment for new class", "Environment of class \"function\" is locked; using global environment for new class", "Environment of class \"S7_object\" is locked; using global environment for new class")
Error in !is.null(prototype) && is.na(match(name, .BasicClasses)) :
'length = 3' in coercion to 'logical(1)'Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels