Closed gaborcsardi closed 10 years ago
By default print.R6(obj)
will simply print out the fields and methods. But I suppose it would be nice to first check for a obj$print
method, and use that first, then fall back to the current output. Is that what you had in mind?
Yes, that's exactly what I meant.
Btw. maybe you can introduce a special prefix for these special methods, e.g. and underscore or a dot. So instead ob obj$print
it would be obj$_print
, and the namespace of methods is not polluted. Just an idea, not particularly important imo.
Implemented in #6.
Is it omitted by design or it will be added later? I realize that I can define an S3 print method, but that is against the encapsulation.