Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
132 commits
Select commit Hold shift + click to select a range
5bb9a20
use isClassUnion() instead of direct class check
lawremi Jun 2, 2026
f72d4f7
pass className attribute directly to preserve package
lawremi Jun 2, 2026
b39346c
since proper S4 classes can extend old classes, be stricter when redu…
lawremi Jun 2, 2026
d2f6a2a
fix is_oldClass() and use it in S4_to_S7_class()
lawremi Jun 3, 2026
c0e431c
initial implementation passing a simple test that does not depend on …
lawremi May 26, 2026
b555430
route S4 class registration through S4_register() and setOldClass(); …
lawremi May 26, 2026
a57ebf2
add a .lintr.R to allow for our symbol naming convention
lawremi May 26, 2026
7c738c4
S4-derived classes gain an initialize() method that mimics the defaul…
lawremi May 26, 2026
ecc7ed1
call S4_register() automatically on S7 derivatives of S4 classes; fi…
lawremi May 26, 2026
acc4990
add some detailed notes on S4 compatibility to docs
lawremi May 26, 2026
a1c439d
fix S7 inheritance checks after rebase
lawremi May 26, 2026
5f88cf6
drop the S7_object case from S4_register
lawremi May 27, 2026
bc8e0e1
docs: recommend use of initialize() when working with S7 derivatives …
lawremi May 27, 2026
e569bfe
clean up inheritance logic changes
lawremi May 27, 2026
ae224f0
just remove classes that exist instead of using try()
lawremi May 27, 2026
a7bf54a
update the global variables for our use of @, which still confuses co…
lawremi May 27, 2026
319c8af
clean up constructor generation
lawremi May 27, 2026
9b38c5a
fix test guarding against extension of S4 classes
lawremi May 27, 2026
af08d0e
allow abstract classes to inhert from virtual S4 classes
lawremi May 27, 2026
2a6f1ba
clean up S4 subclass setOldClass() registration; now supports more co…
lawremi May 28, 2026
608d1d1
more tweaks to subclass registration
lawremi May 28, 2026
ecafb3d
make S7_class_name robust to invocation at package build time
lawremi May 28, 2026
92012ba
reformat
lawremi May 29, 2026
953f4cd
convert() falls back to methods::as()
lawremi May 29, 2026
077363b
correct S4 class name for 'to'
lawremi May 29, 2026
2d5384a
add test
lawremi May 29, 2026
3719698
convert_up() can convert an S4-derived S7 object to an S4 object
lawremi May 29, 2026
79b98e0
clean up and test restricted methods::as() fallback to convert()
lawremi May 29, 2026
e12548e
S4_register() returns the name of the class it registered, which can …
lawremi May 31, 2026
e73e865
rename S4_transient_prototype_class to S4_register_prototype_class an…
lawremi May 31, 2026
a661d5b
support class unions in S4_register()
lawremi May 31, 2026
f8d8ad8
make S4_class() return a methods-friendly class name and have it hand…
lawremi May 31, 2026
0e467ee
support S4 classes extending S7 classes
lawremi May 31, 2026
a191017
move away from do.call(setClass, ...); package is not needed on the p…
lawremi Jun 1, 2026
946d8a2
revert unnecessary direct attr() access
lawremi Jun 1, 2026
81e3459
move a couple more S4 helpers from methods-register.R to S4.R
lawremi Jun 1, 2026
df2f809
S7 classes inherit S4 class unions from S4 parents directly, which s…
lawremi Jun 1, 2026
3d8d6d8
avoid inherited slot conflicts in the S4->S7->S4 inheritance pattern
lawremi Jun 1, 2026
4ecda1e
instead of forwarding S4 class unions into S7 classes, we enable S4_u…
lawremi Jun 1, 2026
267b8d0
update test snapshot after rebase
lawremi Jun 1, 2026
585dd57
represent inheritance from S7_object at the S4 level
lawremi Jun 2, 2026
79bcb07
since @<- will dispatch to S7 setting even on S4 objects (derived fro…
lawremi Jun 2, 2026
2c38b8f
inherits2() in prop.c handles S4 object case where class attribute is…
lawremi Jun 2, 2026
23f2697
tweaks to validObject hooks to support additional inheritance patterns
lawremi Jun 2, 2026
29e586b
in obj_type(), isS4() takes precedence over has_S4_class(), since an …
lawremi Jun 2, 2026
bac1148
restore method-register-S4.R; got lost in the rebase shuffle
lawremi Jun 2, 2026
b3937b5
prop storage now uses the S4 sentinel for NULL for low-level compatib…
lawremi Jun 3, 2026
2967e93
push S4 validation guard down into validate() so that it works for va…
lawremi Jun 3, 2026
453893e
Define S4 prototype on the ::S4Slots old class based on property defa…
lawremi Jun 3, 2026
5d069a5
mark the subclass old class as virtual, because there should never be…
lawremi Jun 4, 2026
92368d0
give convert_up() a general as()-based fallback like convert()
lawremi Jun 4, 2026
3a979ef
make the ::S4Slots class non-virtual to enable more convenient constr…
lawremi Jun 4, 2026
22e70c2
drop the up cast coercions (dead end) and instead ensure full slot re…
lawremi Jun 4, 2026
0c57f8e
S3 method registration will also register an S4 method when the gener…
lawremi Jun 4, 2026
2120e3a
abstract S7 classes deriving from S4 classes are represented as ordin…
lawremi Jun 4, 2026
8099cda
old classes were missing S7_class as a declared slot, which can cause…
lawremi Jun 4, 2026
8cffa52
shorten the S4 registration helper name
lawremi Jun 5, 2026
bdb309d
allow multi-argument signature on internal generics via S4 generic de…
lawremi Jun 5, 2026
aa7c92f
S4_initialize sets slots that aren't properties using slot<-, not prop<-
lawremi Jun 5, 2026
2d08506
@<- supports setting slots on S4 objects
lawremi Jun 5, 2026
333cdf5
S4_validate_shim() does not try to validate objects from a "cousin" S…
lawremi Jun 7, 2026
89f8961
adapt validObject() call to S7 validate contract
lawremi Jun 7, 2026
ea28c48
eliminate S7_object::S4Slots from hierarchy to simplify inheritance; …
lawremi Jun 7, 2026
553e368
doc updates
lawremi Jun 7, 2026
c53b006
wording tweak
lawremi Jun 19, 2026
4a58b0b
Another wording tweak
lawremi Jun 19, 2026
5aba67d
rename is_multi_arg_signature to is_plain_list to clarify its (more g…
lawremi Jun 19, 2026
03ecd49
clarify S4_register() by moving early returns earlier
lawremi Jun 19, 2026
61c4b08
move S4 inheritance guidance to the compatbility vignette
lawremi Jun 19, 2026
67e88ae
massive simplification: no longer define ::S4Slots variant to enable …
lawremi Jun 19, 2026
a9c4c7e
add NEWS entry
lawremi Jun 19, 2026
dd0ab39
post-rebase cleanup
lawremi Jun 20, 2026
c88dac5
revert accidental reversion of switch to := syntax
lawremi Jun 20, 2026
ee2212e
tighten up a test
lawremi Jun 20, 2026
1852150
fix local_S4_class(where=); bug was exposed by our stricter version o…
lawremi Jun 20, 2026
e75b66b
API rework: S4_register() always includes properties as slots (what c…
lawremi Jun 20, 2026
abf31be
fix regression from introduction of external generics
lawremi Jun 20, 2026
c88c241
update for rename of @S7_class to @_S7_class
lawremi Jun 23, 2026
02a5348
Fix S4 bridge review findings
t-kalinowski Jun 24, 2026
77edc5d
Fix S4 compatibility review regressions
t-kalinowski Jun 24, 2026
ca4f885
Fix S4 compatibility regressions
t-kalinowski Jun 24, 2026
b1843a5
Address S4 property review findings
t-kalinowski Jun 24, 2026
a582828
Fix S4 storage edge cases
t-kalinowski Jun 24, 2026
d957dc7
Fix S4 parent initialization and defaults
t-kalinowski Jun 24, 2026
0b960b2
Fix S4 deferred defaults
t-kalinowski Jun 24, 2026
2c5cdb0
Reject internal S4 metadata during upcasts
t-kalinowski Jun 24, 2026
1fa1586
Fix S4 slot storage and S7 marker checks
t-kalinowski Jun 24, 2026
63fb2e3
Fix S4 renamed slots and abstract parent registration
t-kalinowski Jun 24, 2026
f133306
Fix S7/S4 abstract dispatch and virtual initialization
t-kalinowski Jun 24, 2026
69b7673
Fix S4 registration regressions
t-kalinowski Jun 24, 2026
ac79ae5
Fix S4 package identity regressions
t-kalinowski Jun 24, 2026
4acdd30
Fix S4 initialization metadata handling
t-kalinowski Jun 24, 2026
299f715
Fix S4 subclass default initialization
t-kalinowski Jun 24, 2026
54bf928
Fix S4 initialization review findings
t-kalinowski Jun 24, 2026
99fe5a8
Fix S4 inheritance matching and dispatch markers
t-kalinowski Jun 24, 2026
c318a5a
Fix S4 slot validation and local generic registration
t-kalinowski Jun 24, 2026
e76182c
Fix S4 bridge validation regressions
t-kalinowski Jun 24, 2026
52a9ba7
Fix S4 registration and data-part collisions
t-kalinowski Jun 24, 2026
4aad829
Fix S4 registration and validation review findings
t-kalinowski Jun 24, 2026
2ead880
Fix S4-backed registration and validation
t-kalinowski Jun 24, 2026
01b4b4e
Fix S4 registration review findings
t-kalinowski Jun 24, 2026
6cbb08a
Defer S4 validation during initialization
t-kalinowski Jun 24, 2026
3ebcc35
Preserve S4 class package during validation
t-kalinowski Jun 24, 2026
5b5e917
Fix S3 S4 registration matching
t-kalinowski Jun 24, 2026
b1969ae
Fix S4 name identity checks
t-kalinowski Jun 24, 2026
bab78ab
Preserve package-qualified S4 class identities
t-kalinowski Jun 24, 2026
bf1cf5a
Reject S4 slot accessor overrides
t-kalinowski Jun 25, 2026
6201d77
Fix S4-backed S7 validation and data parts
t-kalinowski Jun 25, 2026
46b4c4f
Fix S4 data-part and validity edge cases
t-kalinowski Jun 25, 2026
569b0df
Fix S4 union package identity
t-kalinowski Jun 25, 2026
9482eb5
Fix S4 constructor review findings
t-kalinowski Jun 25, 2026
4d98653
Preserve S7_object inheritance for data-part S4 shims
t-kalinowski Jun 25, 2026
ed6915d
Fix S4 union registration and validity skips
t-kalinowski Jun 25, 2026
67d31f6
Fix S4 union identity matching
t-kalinowski Jun 25, 2026
2b856fd
Fix S4-backed S7 invariants
t-kalinowski Jun 25, 2026
14afa64
Reject S4 parents with implicit data parts
t-kalinowski Jun 25, 2026
107d3e8
Avoid reinitializing S4 validity proxies
t-kalinowski Jun 25, 2026
90a664a
Fix S4 registration review findings
t-kalinowski Jun 25, 2026
b365755
Fix installed S4 compatibility checks
t-kalinowski Jun 25, 2026
1a61beb
Fix S4 registration storage handling
t-kalinowski Jun 25, 2026
f90a9dd
Avoid methods C entry point for S4 validity
t-kalinowski Jun 25, 2026
3d2d977
Preserve S7 property names through S4 parents
t-kalinowski Jun 25, 2026
3ac9c39
Refresh stale S7 property class registration
t-kalinowski Jun 25, 2026
6a048a6
Fix S4 data parts and union subclasses
t-kalinowski Jun 25, 2026
fbf04d2
Fix S4/S7 registration and validation edge cases
t-kalinowski Jun 25, 2026
18be07d
Preserve S4 .S3Class slots for S7 children
t-kalinowski Jun 25, 2026
be64d9d
Preserve S4 data part attributes
t-kalinowski Jun 25, 2026
48c749e
Check S4 slot types for S7 subclasses
t-kalinowski Jun 25, 2026
279fd8e
Preserve S7_class property when upcasting
t-kalinowski Jun 25, 2026
2988150
Fix S4 data-part replacement and contains validation
t-kalinowski Jun 25, 2026
8fa70fb
Simplify S4 compatibility helpers
t-kalinowski Jun 25, 2026
c582779
Reduce S4 compatibility test duplication
t-kalinowski Jun 25, 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 @@ -41,6 +41,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