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

Adapt abbreviation algorithm to not visit complete mismatch structures #216

Merged
merged 4 commits into from
Sep 4, 2023

Conversation

philomates
Copy link
Collaborator

I was testing the experimental abbreviation feature on a list of datomic entities and noticed some new exceptions.
Datomic entities are tricky to work with in the presence of clojure.walk functions because you can't assoc/cons onto them. Generally matcher-combinators doesn't work too well on them but because of this.

In this particular case, I realized that it was because the walk was descending into missing/unexpected data, which shouldn't be abbreviated at all. If that data is a datomic entity, it raises an exception. So to avoid such exceptions, and data traversal, I added a patched version of prewalk that allows not descending into elements that satisfy a predicate.

@philomates philomates merged commit a5f00f6 into master Sep 4, 2023
2 checks passed
@philomates philomates deleted the skip-walk branch September 4, 2023 13:42
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.

1 participant