Extend set notation to allow excluding matches #21
Labels
No labels
bug
duplicate
enhancement/documentation
enhancement/feature
enhancement/organization
question
rejected
upstream
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
UserCurt/mpath#21
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This issue proposes new syntax extending sets from #3 to exclude matches. The proposal uses a set difference approach.
One proposed syntax is to deliminate within the set syntax. Using a hyphen, an example would be
/X/{* - A}/Ywhere*would match all fields ofXandAwould be removed from this set. An alternative proposed syntax is to deliminate outside the set syntax, such as in/X/{*}-{A}/Y, though in this syntax it may not be immediately clear to the user that{*}-{A}acts as a unit.Commas are union operations as normal from #3 not only for the inclusion side but also the exclusion side in the set difference, like in
/X/{A*, B*, C* - A1, ?2, C?*}/Y. This is one aspect of the alternative syntax that may be better as each side of{A*, B*, C*}-{A1, ?2, C?*}in/X/{A*, B*, C*}-{A1, ?2, C?*}/Yis clearly an independent set.It is unclear at this time how this would interact with #19. Perhaps set differences could apply to not just individual fields but whole arrays of segments. An open question would be whether
A/B/Cshould be removed from/A{/*/C - /B}or not. My intuition says no as you would need to do/A{/*/C - /B/C}to do that.