Require a chunk boundary at the last segment in remove #49

Closed
opened 2026-08-01 19:47:40 +00:00 by UserCurt · 1 comment
Owner

When using remove, terminal suffixes like /A/B/C can be held together. It then walks through A and B separately before removing C, which effectively is another chunker which could result in surprising behavior in some circumstances, especially with custom indexing with RedefinesDot.

Before removing the member, MPath should materialize the parent of the final segment.

parent = data.A.B;
[parent, removed] = mpath.internal.member.remove(parent, "C");

if removed
    data.A.B = parent;
end

When using remove, the chunker should require a boundary before the final segment:

/A/B/C       -> /A/B<1>/C
/A/B<1>/C    -> /A/B<1>/C
/A<1>/B/C    -> /A<1>/B<1>/C

With this change, the write-back process of remove should no longer iterative traverse member segments of any chunk.

One purpose of resolve is to give users a preview of the chunks to see the expected behavior. If remove requires the final segment member to be in a dedicated chunk, then resolve may require context information such as it is being used for remove. This could affect issue #48 in that both affect chunker behavior.

When using `remove`, terminal suffixes like `/A/B/C` can be held together. It then walks through `A` and `B` separately before removing `C`, which effectively is another chunker which could result in surprising behavior in some circumstances, especially with custom indexing with `RedefinesDot`. Before removing the member, MPath should materialize the parent of the final segment. ```matlab parent = data.A.B; [parent, removed] = mpath.internal.member.remove(parent, "C"); if removed data.A.B = parent; end ``` When using `remove`, the chunker should require a boundary before the final segment: ```text /A/B/C -> /A/B<1>/C /A/B<1>/C -> /A/B<1>/C /A<1>/B/C -> /A<1>/B<1>/C ``` With this change, the write-back process of `remove` should no longer iterative traverse member segments of any chunk. One purpose of `resolve` is to give users a preview of the chunks to see the expected behavior. If `remove` requires the final segment member to be in a dedicated chunk, then `resolve` may require context information such as it is being used for `remove`. This could affect issue #48 in that both affect chunker behavior.
UserCurt added this to the Release v1 milestone 2026-08-01 19:47:40 +00:00
Author
Owner

Fixed/implemented in 2c06ce4. remove now always has the last segment being a chunk. Users can now specify Context named argument to resolve.

Contexts may be extended or revised to address issue #48.

Fixed/implemented in `2c06ce4`. `remove` now always has the last segment being a chunk. Users can now specify `Context` named argument to `resolve`. Contexts may be extended or revised to address issue #48.
Sign in to join this conversation.
No description provided.