Re: [Rd] Plans to improve reference classes?

2015-06-23 Thread Hadley Wickham
1) Is there any example or writeup on the difficulties of extending reference classes across packages? Just so I can fully understand the issues. Here's a simple example: library(scales) library(methods) MyRange - setRefClass(MyRange, contains = DiscreteRange) a_range - MyRange()

Re: [Rd] Plans to improve reference classes?

2015-06-23 Thread John Chambers
I understand Hadley's point; it's a consequence of the modification of the environment of the ref. class methods. Good point, but it seems we can make that an option (there are advantages to it of code quality and ease of writing, when it works); Let's discuss possibilities, off-list until

Re: [Rd] Plans to improve reference classes?

2015-06-23 Thread Michael Lawrence
Could of requests: 1) Is there any example or writeup on the difficulties of extending reference classes across packages? Just so I can fully understand the issues. 2) In what sorts of situations does the performance of reference classes cause problems? Sure, it's an order of magnitude slower

Re: [Rd] Plans to improve reference classes?

2015-06-23 Thread Winston Chang
I can provide a little background on why particular choices were made for R6. Generally speaking, speed is a primary consideration in making decisions about the design of R6. The basic structure of R6 classes is actually not so different from reference classes: an R6 object is an environment. But

Re: [Rd] Plans to improve reference classes?

2015-06-22 Thread Hadley Wickham
Apart from speed, the most important advantage of R6 over ref classes is that's it easy to subclass a class defined in package A in package B. This is currently difficult with ref classes because of the way it does scoping. (And I think it's difficult to fix without fundamentally changing how ref

Re: [Rd] Plans to improve reference classes?

2015-06-22 Thread Gábor Csárdi
On Mon, Jun 22, 2015 at 9:49 AM, Michael Lawrence lawrence.mich...@gene.com wrote: [...] Would you please provide the details on this test case, including your benchmarks, and what you are trying to achieve at the high-level? You can also see http://rpubs.com/wch/17459 Linked from

Re: [Rd] Plans to improve reference classes?

2015-06-22 Thread Michael Lawrence
(Moved to R-devel) Niek, Would you please provide the details on this test case, including your benchmarks, and what you are trying to achieve at the high-level? Thanks, Michael On Wed, Jun 17, 2015 at 4:55 AM, Niek Bouman niek.bou...@keygene.com wrote: Dear R-core team, I was wondering