Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experimental elision feature fix: Preserve metadata on sets to make it work with feature #225

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

philomates
Copy link
Collaborator

fixes #222

For example, with `(match? [#{2}] [#{1 2}])` it currently gives
`[#{(unexpected 1)} ...]`

This feels misleading to me because there aren't more elements in the
vector that are being elided.

It should be more like `[#{(unexpected 1) ...}]` or at worst
something like `[#{(unexpected 1) ...} ...]`
@@ -246,7 +246,8 @@

(defn- type-preserving-mismatch [base-list values]
(let [lst (into base-list values)]
(if (vector? base-list)
(if (or (vector? base-list)
(set? base-list))
lst
(reverse lst))))
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

without this change we were turning a set into a list due to reverse

@philomates philomates changed the title Experimental ellision feature fix: Preserve metadata on sets to make it work with feature Experimental elision feature fix: Preserve metadata on sets to make it work with feature Jan 17, 2025
(:unmatched result)))
(:elements result))
::result/value
#(with-mismatch-meta % :mismatch-sequence)))))
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add :mismatch-sequence metadata, which is used by the elision feature, to the result of any-order/set mismatch results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Case when enabling abbreviation results in no useful mismatch info
1 participant