[Rd] Adding support for S7 to base R

Duncan Murdoch murdoch@dunc@n @end|ng |rom gm@||@com
Sat Feb 18 15:15:44 CET 2023


I hadn't been aware of the S7 project, but I've read some of the online 
docs about it.  It looks like a nice evolution of S3 & S4. I have a few 
questions:

Is the proposal is that these patches be included in the upcoming R 4.3.0?

One minor thing missing from the docs (as far as I could see) is how 
ambiguities in multi-dispatch are resolved.  For example, having class B 
inherit from class A, and having methods defined for arguments of type 
B, A and type A, B but not B, B, then passing a B, B pair to the 
generic. Which method gets called, or does the ambiguity result in an error?

Another (possibly quite major) omission from the documentation is how 
documentation for classes, generics and methods would be handled.  Using 
one of their examples, how would I find help on what this does: 
`speak(dog(), french())`?

Duncan Murdoch

On 17/02/2023 3:36 p.m., Tomasz Kalinowski wrote:
> Dear R-devel,
> 
> We are pleased to inform you that the R Consortium OOP Working Group
> has been making progress on the S7 (formerly named R7) package and are
> preparing to submit it to CRAN. The S7 package is a new OOP system
> designed to be a successor to S3 and S4.
> 
> As part of that effort, the group has identified a minimal set of
> narrow changes to base R that would allow S7 to exist as a CRAN
> package. The changes, in general, enable S7 to use R language features
> that are presently limited to only S4.
> 
> The proposed patches:
> 
> -  make `@` an S3 generic.
> -  make `%*%` an S3 generic.
> -  enable double dispatch for S7.
> -  enable `inherits()` to accept `S7_class` objects.
> 
> The diffs for the individual patches can be found here:
> 
> %*%      - https://github.com/r-devel/r-svn/pull/105.diff
> inherits - https://github.com/r-devel/r-svn/pull/106.diff
> Ops      - https://github.com/r-devel/r-svn/pull/107.diff
> @        - https://github.com/r-devel/r-svn/pull/108.diff
> 
> The repository for the S7 package can be found here:
> https://github.com/RConsortium/OOP-WG
> 
> Your feedback is important to us, and we would be grateful for your
> input on these patches. We aim to ensure that S7 is a high-quality
> package that benefits the R community, while being mindful of not
> disrupting existing projects or introducing breaking changes. If you
> have any concerns or objections, please let us know. Your insights and
> suggestions will be instrumental in shaping the final version of these
> patches, and we appreciate your help in this process.
> 
> Thank you for your attention and contributions.
> 
> Best regards,
> Tomasz
> On behalf of the R Consortium OOP Working Group
> 
> ______________________________________________
> R-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



More information about the R-devel mailing list