Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Printing private members doesn't work #26

Closed
wch opened this issue Sep 2, 2014 · 0 comments
Closed

Printing private members doesn't work #26

wch opened this issue Sep 2, 2014 · 0 comments

Comments

@wch
Copy link
Member

@wch wch commented Sep 2, 2014

Example:

Simple <- R6Class("Simple",
  public = list(x=1),
  private = list(y=2)
)
s <- Simple$new()
s
# <Simple>
#   Public:
#     x: 1

For non-portable objects, printing private members works:

Simple <- R6Class("Simple",
  portable=FALSE,
  public = list(x=1),
  private = list(y=2)
)
s <- Simple$new()
s
# <Simple>
#   Public:
#     private: environment
#     self: environment
#     x: 1
# 
#   Private:
#     y: 2
# 

The problem is that for portable objects, there's no direct reference to the private environment; the only way to get there is via the environment of a method.

@wch wch closed this in 2312cc5 Jun 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant