Re: [Bioc-devel] role of replaceSlots in BiocGenerics

2017-09-07 Thread Michael Lawrence
Totally agree that the methods package could have a better API and better documentation. Michael On Wed, Sep 6, 2017 at 4:16 PM, Hervé Pagès wrote: > On 09/06/2017 03:51 PM, Michael Lawrence wrote: >> >> On Wed, Sep 6, 2017 at 2:23 PM, Hervé Pagès wrote: >>> >>> Hi, >>> >>> Personally I like

Re: [Bioc-devel] role of replaceSlots in BiocGenerics

2017-09-06 Thread Hervé Pagès
On 09/06/2017 03:51 PM, Michael Lawrence wrote: On Wed, Sep 6, 2017 at 2:23 PM, Hervé Pagès wrote: Hi, Personally I like replaceSlots() better. Not only because it's more readable but also the fact that you can use initialize() to update an existing object is an undocumented feature so I pref

Re: [Bioc-devel] role of replaceSlots in BiocGenerics

2017-09-06 Thread Hervé Pagès
On 09/06/2017 03:53 PM, Hervé Pagès wrote: One of the reasons it's not exported is because it started as something kind of experimental and we didn't find a good home for it yet. I could probably move it to S4Vectors where we already have some low-level S4-related utils. Not the best home either

Re: [Bioc-devel] role of replaceSlots in BiocGenerics

2017-09-06 Thread Hervé Pagès
One of the reasons it's not exported is because it started as something kind of experimental and we didn't find a good home for it yet. I could probably move it to S4Vectors where we already have some low-level S4-related utils. Not the best home either but maybe better than in BiocGenerics? IMO

Re: [Bioc-devel] role of replaceSlots in BiocGenerics

2017-09-06 Thread Michael Lawrence
On Wed, Sep 6, 2017 at 2:23 PM, Hervé Pagès wrote: > Hi, > > Personally I like replaceSlots() better. > > Not only because it's more readable but also the fact that you can use > initialize() to update an existing object is an undocumented feature so > I prefer to not rely on it. > It seems docum

Re: [Bioc-devel] role of replaceSlots in BiocGenerics

2017-09-06 Thread Vincent Carey
I am getting complaints from CMD check about ::: which seems necessary to use this replaceSlots facility because it is not exported. I will look into initialize, which might work fine for my concern. I cannot remember why I did not just use direct assignment to slots, however. Perhaps I just fou

Re: [Bioc-devel] role of replaceSlots in BiocGenerics

2017-09-06 Thread Hervé Pagès
Hi, Personally I like replaceSlots() better. Not only because it's more readable but also the fact that you can use initialize() to update an existing object is an undocumented feature so I prefer to not rely on it. Also initialize() is a generic and there could be a method defined for the obje

Re: [Bioc-devel] role of replaceSlots in BiocGenerics

2017-09-06 Thread Michael Lawrence
No, the best practice is to just use initialize(). It used to be that replaceSlots() saved some copying, but that's no longer really the case. The only potential benefit is that it can skip validity checks, but usually you want those. Michael On Wed, Sep 6, 2017 at 12:55 PM, Vincent Carey wrote:

[Bioc-devel] role of replaceSlots in BiocGenerics

2017-09-06 Thread Vincent Carey
Is this the preferred way of adjusting content in a live object? It is not accessible except via ":::" [[alternative HTML version deleted]] ___ Bioc-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/bioc-devel