Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Test/Testset using ScopedValue #51012

Closed
wants to merge 23 commits into from
Closed

Conversation

vchuravy
Copy link
Member

No description provided.

vchuravy and others added 23 commits August 22, 2023 12:45
ScopedVariables are containers whose observed value depends the current
dynamic scope. This implementation is inspired by https://openjdk.org/jeps/446

A scope is introduced with the `scoped` function that takes a lambda to
execute within the new scope. The value of a `ScopedVariable` is
constant within that scope and can only be set upon introduction
of a new scope.

Scopes are propagated across tasks boundaries.

In contrast to #35833 the storage of the per-scope data is assoicated
with the ScopedVariables object and does not require copies upon scope
entry. This also means that libraries can use scoped variables without
paying for scoped variables introduces in other libraries.

Finding the current value of a ScopedVariable, involves walking the
scope chain upwards and checking if the scoped variable has a value
for the current or one of its parent scopes. This means the cost of
a lookup scales with the depth of the dynamic scoping. This could be
amortized by using a task-local cache.
Co-authored-by: Rafael Fourquet <fourquet.rafael@gmail.com>
Co-authored-by: Nick Robinson <npr251@gmail.com>
@brenhinkeller brenhinkeller added the testsystem The unit testing framework and Test stdlib label Aug 23, 2023
@vchuravy vchuravy force-pushed the vc/scopedvariables branch from 804343f to 8bcaf3a Compare August 24, 2023 01:49
@vchuravy vchuravy force-pushed the vc/scopedvariables branch 2 times, most recently from 64d75e6 to 08d9224 Compare September 7, 2023 17:59
@vchuravy vchuravy force-pushed the vc/scopedvariables branch 3 times, most recently from 912257a to 98074e0 Compare September 15, 2023 20:18
Base automatically changed from vc/scopedvariables to master September 16, 2023 12:51
@vchuravy vchuravy added the help wanted Indicates that a maintainer wants help on an issue or pull request label Feb 14, 2024
@vchuravy vchuravy closed this Feb 25, 2024
@vchuravy vchuravy deleted the vc/scoped_tests branch February 25, 2024 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Indicates that a maintainer wants help on an issue or pull request testsystem The unit testing framework and Test stdlib
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants