I love the idea of stating a constraint as an equation. However, using the bare equality and comparison operators for this purpose seems semantically incorrect and is bound to make the code harder to understand than it should be. I would suggest that we surround the equality and comparison operators with vertical bars to indicate "constraint". For example:
view.topAnchor |>=| container.topAnchor + 5
This also lets us change the operator precedence if we need to.
In order to preserve backward compatibility, we could make the adorned operators the default, but allow bare operators via conditional compilation.
If you are interested in this, I could put a PR together.
Thanks for the feedback, but at this time we are going to stick with the ==, <= and >= operators because they are familiar to most users, and show clear intent especially with regards to the inequalities.
I love the idea of stating a constraint as an equation. However, using the bare equality and comparison operators for this purpose seems semantically incorrect and is bound to make the code harder to understand than it should be. I would suggest that we surround the equality and comparison operators with vertical bars to indicate "constraint". For example:
This also lets us change the operator precedence if we need to.
In order to preserve backward compatibility, we could make the adorned operators the default, but allow bare operators via conditional compilation.
If you are interested in this, I could put a PR together.