Skip to content

Clarify behavior of B~ A~ B A #2

@shicks

Description

@shicks

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]();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions