Skip to content

Refactor internal state: scope state env + callable S7 R2F handlers#97

Merged
t-kalinowski merged 6 commits intomainfrom
refactor/s7-scope-handler-metadata
Feb 9, 2026
Merged

Refactor internal state: scope state env + callable S7 R2F handlers#97
t-kalinowski merged 6 commits intomainfrom
refactor/s7-scope-handler-metadata

Conversation

@t-kalinowski
Copy link
Owner

This refactors internal object/state management to reduce ad-hoc attributes and make compiler state easier to reason about.

Changes

  • Keep quickr_scope as an environment (reference semantics), but move mutable per-scope state into a dedicated attr(scope, "state") env with explicit helpers.
  • Introduce callable S7 R2FHandler (inherits from class_function) to store handler metadata as properties (replacing attr(handler, ...)).
  • Move Fortran lowering metadata off arbitrary attributes onto explicit S7 properties.

Testing

  • R -q -e "Sys.setenv(TESTTHAT_PARALLEL="false"); rcmdcheck::rcmdcheck(error_on="warning")" (Status: OK; 0 errors, 0 warnings, 0 notes)
  • Coverage maintained (covr was >= baseline before/after refactor).

Notes

  • Handler call sites now read handler metadata via S7 properties (with compatibility for non-registered functions where needed).

@codecov
Copy link

codecov bot commented Feb 9, 2026

Codecov Report

❌ Patch coverage is 97.25275% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.93%. Comparing base (2f8206c) to head (51e4988).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
R/r2f-aab-core.R 90.90% 2 Missing ⚠️
R/error-handling.R 80.00% 1 Missing ⚠️
R/r2f-aaa-registry.R 92.30% 1 Missing ⚠️
R/scope.R 96.87% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #97      +/-   ##
==========================================
+ Coverage   92.89%   92.93%   +0.03%     
==========================================
  Files          27       28       +1     
  Lines        5859     5941      +82     
==========================================
+ Hits         5443     5521      +78     
- Misses        416      420       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@t-kalinowski t-kalinowski merged commit f0f4fa1 into main Feb 9, 2026
7 of 8 checks passed
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.

1 participant