Skip to content
Prev 11490 / 21312 Next

[Bioc-devel] role of replaceSlots in BiocGenerics

On 09/06/2017 03:51 PM, Michael Lawrence wrote:
But before that paragraph:

      The generic function 'initialize' is not called directly. A call
      to 'new' begins by copying the prototype object from the class
      definition, and then calls 'intialize()' with this object as the
      first argument, followed by the ... arguments.

There are no examples showing the use of initialize() for updating an
existing object. So one has to kind of guess that it is OK to call
initialize() directly and in a context that is different from
initialization (i.e. on an "existing" object, not just on the prototype
object).

Might be obvious for S4 wizards but I like my code to be readable by
the average developer. First time I saw the use of initialize() for
updating purpose (a few years ago), I found it quite confusing.
Fair enough...

H.