Skip to content

Conversation

@josevalim
Copy link
Member

No description provided.

`*` `/` | Left
`+` `-` | Left
`++` `--` `+++` `---` `..` `<>` | Right
`//` (valid only inside `..//`) | Right
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need it here if it is only valid as part of ternary operator?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because precedence still applies with operators outside of the ternary.

@lukaszsamson
Copy link
Contributor

Should we also document operator arguments evaluation order? It may not be obvious in case of ternary operators

@josevalim
Copy link
Member Author

Should we also document operator arguments evaluation order? It may not be obvious in case of ternary operators

Because of macros, argument evaluation order is dependent on how they are implemented, rather than how they are parsed.

@josevalim josevalim merged commit e2c4c07 into main Dec 1, 2025
1 check passed
@josevalim josevalim deleted the jv-ternary-operators branch December 1, 2025 09:49
@josevalim
Copy link
Member Author

💚 💙 💜 💛 ❤️

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants