Expand description
S3 class wrapper generator (structure() + generic.Class dispatch).
S3-class R wrapper generator.
Generates lightweight, single-dispatch S3 generics with
<generic>.<class> methods. Method dispatch is driven by the class()
attribute vector — first match wins — so inheritance is “string-prefix”
based and cheap. No formal slot validation, no multi-dispatch (vctrs-style
double-dispatch is supported via #[miniextendr(s3(generic = "...", class = "..."))] for
vec_ptype2.a.b patterns). Pick S3 for tidyverse interop and for
extending existing base generics (print, format, summary); use S4/S7
when you need validation or formal hierarchies.
Functions§
- generate_
s3_ class - Generates the R wrapper of an S3-style class, in the parts the wrapper
writer merges per type (
super::ClassWrapper, #1776). - no_
constructor_ 🔒head - The head of an S3 or vctrs class without a constructor:
kindis the class system in its title,importsits roxygen imports. Neither gets anew_<class>(): a package that builds its objects in R may write its own (#2069).