r-lib / R6

Encapsulated object-oriented programming for R
https://R6.r-lib.org
Other
405 stars 56 forks source link

Implement .DollarNames #97

Closed hadley closed 7 years ago

hadley commented 7 years ago

So that autocomplete gives a full list of all fields/methods, not just those in the highest class.

hadley commented 7 years ago

Doesn't seem to be necessary

library(R6)

A <- R6Class("A", public = list(A = 1))
B <- R6Class("B", public = list(B = 2), inherit = A)
b <- B$new()

.DollarNames(b)
#> [1] ".__enclos_env__" "B"               "A"               "clone"