Plan and validate mutations before applying them #41

Closed
opened 2026-07-19 15:05:53 +00:00 by UserCurt · 1 comment
UserCurt commented 2026-07-19 15:05:53 +00:00 (Migrated from codeberg.org)

set and remove currently process input pointers one at a time. Targets are modified immediately as iterating through the pointers, mutating along the way. There are two issues with this:

  • An earlier mutation can change which targets a later pointer finds
  • A later validation error can happen after an earlier mutation has already changed a handle object

This issue proposes implementing mutation functions as two separate phases, a planning traversal phase followed by a mutation phase. In the planning phase, each target that would be modified will be queued up. In the mutation phase, the queue will be iterated through, and mutations will then be applied. This way, the validation that occurs during the planning phase will throw errors prior to any actual mutation.

In is suggested to address this issue after implementing the shared traversal engine in #40.

It may be helpful to consider intended behavior in issue #35 for groupings prior to implementation.

`set` and `remove` currently process input pointers one at a time. Targets are modified immediately as iterating through the pointers, mutating along the way. There are two issues with this: - An earlier mutation can change which targets a later pointer finds - A later validation error can happen after an earlier mutation has already changed a handle object This issue proposes implementing mutation functions as two separate phases, a planning traversal phase followed by a mutation phase. In the planning phase, each target that would be modified will be queued up. In the mutation phase, the queue will be iterated through, and mutations will then be applied. This way, the validation that occurs during the planning phase will throw errors prior to any actual mutation. In is suggested to address this issue after implementing the shared traversal engine in #40. It may be helpful to consider intended behavior in issue #35 for groupings prior to implementation.
Owner

Completed by commit a03e30b. This implemented commit modified resolve and set to finish issue #40 while simultaneously tackling this issue #41.

Note that mutations are performed in linear ordering. This may change in the future when working with terminal #42 and possibly also non-terminal #45 comma-separated list operations. Reason is because basically because [A.B] = deal(...) "simultaneously" assigns each output of A.B so the ordering is required to be consecutive.

Completed by commit `a03e30b`. This implemented commit modified `resolve` and `set` to finish issue #40 while simultaneously tackling this issue #41. Note that mutations are performed in linear ordering. This may change in the future when working with terminal #42 and possibly also non-terminal #45 comma-separated list operations. Reason is because basically because `[A.B] = deal(...)` "simultaneously" assigns each output of `A.B` so the ordering is required to be consecutive.
Sign in to join this conversation.
No description provided.