On Wed, Mar 27, 2019 at 6:27 PM Abs Spurdle <spurdl...@gmail.com> wrote: > > > the prison made by ancient design choices > > That prison of ancient design choices isn't so bad. > > I have no further comments on object oriented semantics. > However, I'm planning to follow the following design pattern. > > If I set the class of an object, I will append the new class to the > existing class. > > #good > class (object) = c ("something", class (object) ) > > #bad > class (object) = "something" > > I encourage others to do the same.
I don't think this is a good pattern. It's better to clearly define a constructor function that checks that `object` is the correct underlying base type for your class - https://adv-r.hadley.nz/s3.html#s3-classes. Hadley -- http://hadley.nz ______________________________________________ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel