[Rd] Adding support for S7 to base R

Ezra Tucker ezr@ @end|ng |rom |@ndtucker@com
Mon Mar 13 16:53:56 CET 2023


I don't know if this is the right forum, but I'd like to ask an open-ended
question about the goals of the S7 OOP system, which is, where do we see
the ultimate future of object-oriented programming in R being? Do we see S7
eventually complementing S3 and S4 in "base" (in quotes because S4 is
provided by the methods package), or do we see (or even wish?) for S7 to
supplant both S3 and S4 eventually within base R?

My own personal experience, I usually use S4 - why, because it's there, and
also, some of my favorite packages (sp and Matrix) use it, and I like my
code to look like the source code for the language. To that end, when I'm
training up engineers or data scientists to use OOP in R, I have them look
at source code-- but then also have to be choosy about source code for what
lest they become confused by the differences between S3 and S4 (not to
mention R6, RC, and whatever else might be out there).

R is the only language I know of that has multiple different object
oriented systems, and that makes it a big barrier to entry for people
learning the language, and I think the language as a whole would benefit
greatly from having a single standard.

-Ezra

On Sat, Feb 18, 2023 at 12:38 PM Duncan Murdoch <murdoch.duncan using gmail.com>
wrote:

> On 18/02/2023 9:51 a.m., Duncan Murdoch wrote:
> > One more comment:
> >
> > The utils::setBreakpoint() function should be updated to be able to set
> > breakpoints in S7 methods, or a substitute function should be added to
> > the S7 package.
> >
> > RStudio 2022.12.0+353 (not sure if that's the latest) also needs to be
> > taught how to do that, since it doesn't seem to use setBreakpoint.
>
> I took a look at updating setBreakpoint().  I can get findLineNum() to
> work, but setBreakpoint() doesn't work because trace() doesn't work.
> debug() doesn't work either:  it looks as though it is trying to treat
> an S7 method as an S4 method.
>
> Will the already proposed changes help with debugging, or is that a
> completely separate issue?
>
> Duncan Murdoch
>
> ______________________________________________
> R-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

	[[alternative HTML version deleted]]



More information about the R-devel mailing list