Skip to content

Make using :via with :default work and take precedence over :pred only - #25

Open
martin-senft-flexiana wants to merge 2 commits into
alexanderkiel:masterfrom
Zimpler:allow_via_without_pred
Open

Make using :via with :default work and take precedence over :pred only#25
martin-senft-flexiana wants to merge 2 commits into
alexanderkiel:masterfrom
Zimpler:allow_via_without_pred

Conversation

@martin-senft-flexiana

Copy link
Copy Markdown

This makes having a single phraser cover all possible failure cases for one spec
possible with (defphraser :default {:via [::some-spec]}).

@alexanderkiel

Copy link
Copy Markdown
Owner

I see. That would be useful for overly complex predicates were you have a defined spec on a keyword. Than it's easier to dispatch on :via instead of dispatching on the predicate.

Can you pleas add a section to the README explaining and motivating this with your example? Tanks!

@martin-senft-flexiana

Copy link
Copy Markdown
Author

Thank you for your quick reaction.

I have added documentation sections for spec-specific default phrasers and phraser matching priorities.

This makes having a single phraser cover all possible failure cases for one spec
possible with `(defphraser :default {:via [::some-spec]})`.
@martin-senft-flexiana

Copy link
Copy Markdown
Author

@alexanderkiel Can you please share you thoughts on the current state of this PR? I would like to know if it still makes sense to you and if it is good enough to be merged.

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.

2 participants