Skip to content

Seshat's Gambit should make a copy of the FrameForEach instead of mutating it in-place #28

@object-Object

Description

@object-Object

Seshat's Gambit currently relies on the interior mutability behaviour of FrameForEach.acc to pop the iota from the accumulator:

val accumulator = frame.acc
if (accumulator.isNotEmpty()){
output = accumulator.removeLast()
}

While this currently works, it will break in the next Hex Casting patch, since we're switching Thoth to use an immutable TreeList internally in FallingColors/HexMod#1031.

To ensure it still works as documented after this patch, OpThothYoink should instead use frame.copy() to copy the frame construct a new FrameForEach (frame.copy() won't work - acc will no longer be a dataclass field) with an updated version of the accumulator, and create a new continuation with the frame replaced.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions