Skip to content

Clarify behavior of B~ A~ B A #2

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

Open
shicks opened this issue Mar 25, 2025 · 0 comments
Open

Clarify behavior of B~ A~ B A #2

shicks opened this issue Mar 25, 2025 · 0 comments

Comments

@shicks
Copy link

shicks commented Mar 25, 2025

There are a number of permutations of this that we need to think about. Specifically:

"run, enter, end-run, dispose" - probably should not restore the 2.

const x = v.withValue(1);
v.run(2, () => x[Symbol.enter]());
x[Symbol.dispose]();

"enter, run, dispose, end-run" - probably should not restore the 1.

const x = v.withValue(1);
x[Symbol.enter]();
v.run(2, () => x[Symbol.dispose]());

"enter A1, enter A2, dispose A1, dispose A2" - probably should not restore the 1.

const x1 = v.withValue(1);
const x2 = v.withValue(2);
x1[Symbol.enter]();
x2[Symbol.enter]();
x1[Symbol.dispose]();
x2[Symbol.dispose]();

Two separate variables - very similar to the previous one, but maybe a non-issue if different vars are completely independent here?

const x1 = v1.withValue(1);
const x2 = v2.withValue(2);
x1[Symbol.enter]();
x2[Symbol.enter]();
x1[Symbol.dispose]();
x2[Symbol.dispose]();
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

No branches or pull requests

1 participant