Expand description
S7 class wrapper generator (new_class / new_generic modern R OOP).
S7-class R wrapper generator.
Generates S7::new_class(...) with value semantics, formal property
validation, and parent-based inheritance. Property attributes
(s7(getter) / s7(setter, prop = "...")) compile to S7::new_property
with @-access semantics, including read-only computed properties and
read-write dynamic ones. Similar formal power to S4 with cleaner syntax,
but the S7 ecosystem is younger and the R-package dependency surface is
evolving. Pick S7 for new packages wanting modern formal OOP (including
multiple dispatch); use S4 when you need Bioconductor compatibility.
EnumsΒ§
- S7Generic
Target π - Where an S7 instance methodβs generic comes from.
ConstantsΒ§
- S7_
BASE_ πS3_ OPERATORS - Operators base R always provides and S7 dispatches on the receiver alone (through the base primitive as an S3 generic).
- S7_
OPS_ πOPERATORS - Rβs
Opsgroup operators. S7 dispatches them on both operands through its own(e1, e2, ...)generics.
FunctionsΒ§
- class_
ref_ πor_ any_ or_ verbatim - S7-property variant of
class_ref_or_verbatimthat asks the resolver to fall back silently toS7::class_anyon miss (unregistered type, or a registered-but-non-S7 class). Prevents the load-timeobject not foundnoise called out in #203. - emit_
s7_ πlocal_ generic - Emit the load-time definition of a package-local S7 generic: define it when no binding exists, shadow a plain (non-generic) function, otherwise reuse the existing generic.
- extract_
prop_ πdoc_ from_ tags - Extract the full property documentation from a getterβs
doc_tagsfor use in@prop <name> <doc>emission. - generate_
s7_ class - Generates the R wrapper of an S7-style class, in the parts the wrapper
writer merges per type (
super::ClassWrapper, #1776). - r_
chr_ πvector - A character vector literal:
"x"orc("x", "y"). - rust_
type_ πto_ s7_ class - Map a Rust return type to an S7 class name.
- s7_
base_ πoperator_ unbind - The line that follows an
S7::method(<op>, ...) <-registration on a base operator:base::rm(list = "<op>"). - s7_
dispatch_ πargs - The S7 dispatch arguments of an instance method:
s7(dispatch = "a, b"), else the pair an operator generic fixes (e1, e2), elsex. - s7_
generic_ πtarget - Classify a methodβs generic name (
ctx.generic_name()). - s7_
method_ πsignature - The
S7::method()signature: the class (orS7::class_anyfor a fallback) for the receiver, andS7::class_anyfor every other dispatch argument. - s7_
operator_ πdispatch_ args - The dispatch arguments S7 fixes for a two-operand operator generic:
(e1, e2)for theOpsgroup,(x, y)for%*%(thematrixOpsgroup). - s7_
shortcut_ πname - Name of the S7 fast-path shortcut
<ClassName>_<method>(#949), orNonewhen that name is not a syntactic R name. - shortcut_
advisory_ πlines - Roxygen prose for the fast-path dispatch shortcut advisory block.