Skip to content
This repository was archived by the owner on Apr 2, 2026. It is now read-only.

Add extra note for left, right and none functions in pratt.rs example#939

Merged
zesterer merged 2 commits into
zesterer:mainfrom
whiskeyo:main
Jan 11, 2026
Merged

Add extra note for left, right and none functions in pratt.rs example#939
zesterer merged 2 commits into
zesterer:mainfrom
whiskeyo:main

Conversation

@whiskeyo

Copy link
Copy Markdown
Contributor

No description provided.

@zesterer

Copy link
Copy Markdown
Owner

What is the goal with this PR?

@whiskeyo

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Owner

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants