Skip to content

Use S7 namespace for base class constructors and validators#665

Merged
hadley merged 4 commits into
mainfrom
constructor-validator-env
Jun 2, 2026
Merged

Use S7 namespace for base class constructors and validators#665
hadley merged 4 commits into
mainfrom
constructor-validator-env

Conversation

@hadley

@hadley hadley commented May 29, 2026

Copy link
Copy Markdown
Member

This avoids capturing the local environment in the case of the validator, and the inconsistent use of the base environment in the case of the constructor. The validator and constructor for the S3 wrappers already used the S7 namespace.

Fixes #553

hadley added 2 commits May 29, 2026 08:14
This avoids capturing the local environment in the case of the validator, and the inconsistent use of the base environment in the case of the constructor. The validator and constructor for the S3 wrappers already used the S7 namespace.

Fixes #553
@hadley hadley requested a review from t-kalinowski June 1, 2026 17:38

@t-kalinowski t-kalinowski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand the motivation for the original issue, but this change seems harmless. I don't recall why we set the baseenv() parent here, though it's clear we went out of our way to do so. I think it might have been around the time we were working on the serialization/dput issues in base R, and this was somehow related.

In either case, this seems fine and simplifies the internals.

@hadley hadley merged commit 9b6a7e0 into main Jun 2, 2026
11 checks passed
@hadley hadley deleted the constructor-validator-env branch June 2, 2026 15:44
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.

should constructor, validator, getter, setter... be enclosed in baseenv()

2 participants