Skip to content

Conversation

@whiskeyo
Copy link
Contributor

No description provided.

@zesterer
Copy link
Owner

What is the goal with this PR?

@whiskeyo
Copy link
Contributor Author

I considered it to be a bit more user-friendly for pratt feature users, since infix takes Associativity as its argument and the direct usage of Associativity::Right(3) might be a bit easier to understand at first than right(3), which is a some kind of helper function.

@zesterer
Copy link
Owner

Hmm, I'm not sure I necessarily agree with that assessment. The docs are quite clear as to what each function does. It's not that I have a strong opinion either way though.

@whiskeyo
Copy link
Contributor Author

That's true. If you feel like this shouldn't be merged, I am not against it and I fully get it, but for me it was quite magic at first when I saw the example 😄

Maybe the example could mention something like:

/// `left`, `right` and `none` are shorthand versions of `Associativity` variants

just before they are used, and the proposed change would be then restored back to the original?

@zesterer
Copy link
Owner

I'd be happy to accept that change, yes

@whiskeyo whiskeyo changed the title Update pratt.rs example with new infix API usage (Associativity) Add extra note for left, right and none functions in pratt.rs example Jan 11, 2026
@zesterer zesterer merged commit b3c1779 into zesterer:main Jan 11, 2026
2 of 4 checks passed
@zesterer
Copy link
Owner

Thanks!

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