Skip to content

Use explicit property defaults with development S7 - #206

Merged
egenn merged 7 commits into
rtemis-org:mainfrom
t-kalinowski:fix/s7-compatibility-20261012
Nov 3, 2026
Merged

egenn merged 7 commits into
rtemis-org:mainfrom
t-kalinowski:fix/s7-compatibility-20261012

Conversation

@t-kalinowski

Copy link
Copy Markdown
Contributor

Development S7 warns when rtemis imports := from both S7 and data.table and when property declarations use evaluated vector or configuration defaults. Exclude data.table's placeholder assignment operator and declare constructor defaults explicitly, for example default = quote(setup_ASWCriterion()) instead of default = setup_ASWCriterion().

The internal property factories evaluate quoted expressions once to validate and retain their declaration metadata, then pass the expressions to S7 for each object construction. The setup functions use that metadata to resolve their defaults.

JSONSchema_to_S7() serializes complex defaults when defining the class and decodes them for each instance, including custom reference decoding. Scalars and plain empty defaults remain direct. When a native parent is supplied, inherited runtime properties retain its declared types.

Add guarded S7 load, unload, and build hooks to clean up method registrations and foreign generic aliases. The build hook runs after method declarations. Released S7 continues to use methods_register(), and the minimum S7 version is unchanged.

Keep validated declaration metadata separate from quoted constructor defaults
and reconstruct complex schema defaults from serialized values per instance.
Keep released S7 compatibility by guarding the new hooks and retaining
methods_register() when S7_on_load() is not exported.
@t-kalinowski

Copy link
Copy Markdown
Contributor Author

Thanks for maintaining rtemis! I'm planning to submit the next version of S7 to CRAN on November 16 (see RConsortium/S7#786).

Would you be able to merge these compatibility changes and submit an updated version of rtemis to CRAN before then? Please let me know if you need more time or if there’s anything I can help with.

@egenn
egenn merged commit 26c254b into rtemis-org:main Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants