Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
6afaae1
use isClassUnion() instead of direct class check
lawremi Jun 2, 2026
57bbdb1
pass className attribute directly to preserve package
lawremi Jun 2, 2026
825cea0
since proper S4 classes can extend old classes, be stricter when redu…
lawremi Jun 2, 2026
119ca5f
fix is_oldClass() and use it in S4_to_S7_class()
lawremi Jun 3, 2026
a3de211
initial implementation passing a simple test that does not depend on …
lawremi May 26, 2026
10aea80
route S4 class registration through S4_register() and setOldClass(); …
lawremi May 26, 2026
69e86b1
add a .lintr.R to allow for our symbol naming convention
lawremi May 26, 2026
82f4840
S4-derived classes gain an initialize() method that mimics the defaul…
lawremi May 26, 2026
f6ff8c3
call S4_register() automatically on S7 derivatives of S4 classes; fi…
lawremi May 26, 2026
64d3690
add some detailed notes on S4 compatibility to docs
lawremi May 26, 2026
0f70a2b
fix S7 inheritance checks after rebase
lawremi May 26, 2026
434a44b
drop the S7_object case from S4_register
lawremi May 27, 2026
c263486
docs: recommend use of initialize() when working with S7 derivatives …
lawremi May 27, 2026
39d19eb
clean up inheritance logic changes
lawremi May 27, 2026
8a360b8
just remove classes that exist instead of using try()
lawremi May 27, 2026
cc43d73
update the global variables for our use of @, which still confuses co…
lawremi May 27, 2026
68e1398
clean up constructor generation
lawremi May 27, 2026
4dc60c5
fix test guarding against extension of S4 classes
lawremi May 27, 2026
abb3569
allow abstract classes to inhert from virtual S4 classes
lawremi May 27, 2026
414551b
clean up S4 subclass setOldClass() registration; now supports more co…
lawremi May 28, 2026
5dc2325
more tweaks to subclass registration
lawremi May 28, 2026
9b9f4da
make S7_class_name robust to invocation at package build time
lawremi May 28, 2026
20d89d6
reformat
lawremi May 29, 2026
e08b1ee
convert() falls back to methods::as()
lawremi May 29, 2026
e366cd6
correct S4 class name for 'to'
lawremi May 29, 2026
88ed4a6
add test
lawremi May 29, 2026
adae124
convert_up() can convert an S4-derived S7 object to an S4 object
lawremi May 29, 2026
279bc23
clean up and test restricted methods::as() fallback to convert()
lawremi May 29, 2026
7cd378a
S4_register() returns the name of the class it registered, which can …
lawremi May 31, 2026
f7d28c3
rename S4_transient_prototype_class to S4_register_prototype_class an…
lawremi May 31, 2026
32907a2
support class unions in S4_register()
lawremi May 31, 2026
67ed28d
make S4_class() return a methods-friendly class name and have it hand…
lawremi May 31, 2026
afcf09b
support S4 classes extending S7 classes
lawremi May 31, 2026
0333e02
move away from do.call(setClass, ...); package is not needed on the p…
lawremi Jun 1, 2026
99e0bad
revert unnecessary direct attr() access
lawremi Jun 1, 2026
b62a9a2
move a couple more S4 helpers from methods-register.R to S4.R
lawremi Jun 1, 2026
c78a6bb
S7 classes inherit S4 class unions from S4 parents directly, which s…
lawremi Jun 1, 2026
9a1a9d7
avoid inherited slot conflicts in the S4->S7->S4 inheritance pattern
lawremi Jun 1, 2026
c7bca26
instead of forwarding S4 class unions into S7 classes, we enable S4_u…
lawremi Jun 1, 2026
c409cbf
update test snapshot after rebase
lawremi Jun 1, 2026
d285419
represent inheritance from S7_object at the S4 level
lawremi Jun 2, 2026
bb0035a
since @<- will dispatch to S7 setting even on S4 objects (derived fro…
lawremi Jun 2, 2026
ef76c1c
inherits2() in prop.c handles S4 object case where class attribute is…
lawremi Jun 2, 2026
ed153f4
tweaks to validObject hooks to support additional inheritance patterns
lawremi Jun 2, 2026
de2c4f2
in obj_type(), isS4() takes precedence over has_S4_class(), since an …
lawremi Jun 2, 2026
630a503
restore method-register-S4.R; got lost in the rebase shuffle
lawremi Jun 2, 2026
edb789f
prop storage now uses the S4 sentinel for NULL for low-level compatib…
lawremi Jun 3, 2026
18a00fc
push S4 validation guard down into validate() so that it works for va…
lawremi Jun 3, 2026
fe3f603
Define S4 prototype on the ::S4Slots old class based on property defa…
lawremi Jun 3, 2026
de2e88e
mark the subclass old class as virtual, because there should never be…
lawremi Jun 4, 2026
23e0f43
give convert_up() a general as()-based fallback like convert()
lawremi Jun 4, 2026
e5804ea
make the ::S4Slots class non-virtual to enable more convenient constr…
lawremi Jun 4, 2026
cd2019f
drop the up cast coercions (dead end) and instead ensure full slot re…
lawremi Jun 4, 2026
ce32015
S3 method registration will also register an S4 method when the gener…
lawremi Jun 4, 2026
f1315e1
abstract S7 classes deriving from S4 classes are represented as ordin…
lawremi Jun 4, 2026
8b5996b
old classes were missing S7_class as a declared slot, which can cause…
lawremi Jun 4, 2026
ac985ce
shorten the S4 registration helper name
lawremi Jun 5, 2026
95dfc6e
allow multi-argument signature on internal generics via S4 generic de…
lawremi Jun 5, 2026
f32bbb9
S4_initialize sets slots that aren't properties using slot<-, not prop<-
lawremi Jun 5, 2026
368ee9d
@<- supports setting slots on S4 objects
lawremi Jun 5, 2026
cadcc4c
S4_validate_shim() does not try to validate objects from a "cousin" S…
lawremi Jun 7, 2026
bfad4cb
adapt validObject() call to S7 validate contract
lawremi Jun 7, 2026
a422af7
eliminate S7_object::S4Slots from hierarchy to simplify inheritance; …
lawremi Jun 7, 2026
00f69a5
doc updates
lawremi Jun 7, 2026
05957b5
wording tweak
lawremi Jun 19, 2026
fefe9e9
Another wording tweak
lawremi Jun 19, 2026
7e47f14
rename is_multi_arg_signature to is_plain_list to clarify its (more g…
lawremi Jun 19, 2026
38b45a3
clarify S4_register() by moving early returns earlier
lawremi Jun 19, 2026
11c8bbd
move S4 inheritance guidance to the compatbility vignette
lawremi Jun 19, 2026
b252c68
massive simplification: no longer define ::S4Slots variant to enable …
lawremi Jun 19, 2026
68d446a
add NEWS entry
lawremi Jun 19, 2026
9439c1d
post-rebase cleanup
lawremi Jun 20, 2026
853963a
revert accidental reversion of switch to := syntax
lawremi Jun 20, 2026
16ab264
tighten up a test
lawremi Jun 20, 2026
14e07f3
fix local_S4_class(where=); bug was exposed by our stricter version o…
lawremi Jun 20, 2026
b9f71f5
API rework: S4_register() always includes properties as slots (what c…
lawremi Jun 20, 2026
6bc5862
fix regression from introduction of external generics
lawremi Jun 20, 2026
cfae9a5
update for rename of @S7_class to @_S7_class
lawremi Jun 23, 2026
616de46
fix a few style / rebase issues
lawremi Jun 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@
^\.claude$
^\.git-blame-ignore-revs$
^AGENTS\.md$
^\.lintr\.R$
1 change: 1 addition & 0 deletions .lintr.R
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
linters <- lintr::linters_with_defaults()
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export("S7_data<-")
export("method<-")
export("prop<-")
export("props<-")
export(S4_contains)
export(S4_register)
export(S7_class)
export(S7_class_desc)
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

* New `:=` operator creates and names an object in one step, so `Foo := new_class()` is equivalent to `Foo <- new_class(name = "Foo")` (#658).
* The class object that S7 stores on each instance now lives in the `_S7_class` attribute (previously `S7_class`), moving it into the `_`-prefixed namespace reserved for S7 internals so it can't collide with a user-defined property. Objects created by an older version of S7 (e.g. serialised to disk or baked into another package's lazy-load database) continue to work, as S7 falls back to the old attribute name when reading them (#677).
* S7 and S4 now interoperate through inheritance. `new_class()` can use an S4 class as a parent, mapping S4 slots to S7 properties and registering the class with S4 automatically. Conversely, `S4_register()` registers an S7 class with S4, and `S4_contains()` returns an S4 class name suitable for `methods::setClass(contains = )`, exposing stored S7 properties as S4 slots for S4 subclasses. This support includes S4 initialization and validity integration, and S4/internal generic registration where needed; see `vignette("compatibility")` for caveats (#456).
* Errors thrown by S7 now report the function where they occurred, making it easier to track down the source of a problem (#646).
* `class_POSIXct` uses the `tzone` attribute (not `tz`), and allows it to be absent (#401).
* Base type wrappers like `class_integer` now define their constructor and validator in the S7 namespace. (#553).
Expand Down
Loading
Loading