When comparing x and y, there are three posibilities
What if you want to find the "opposite" of each of these operations?
Then there are 2 ways to express "inverse" of these primary operations:
1. Negation
Defining in terms of negation.
!(x < y)
!(x = y)
!(x > y)
2. Relational Complement
Defining in terms of what is true instead.
x = y || x > y
x < y || x > y
x < y || x = y
Most programming languages provide shortcut operators for these inverse operations.
Going by the first philosophy, we have:
Going by the second philosophy, we have:
The dilemma, as someone who is designing a language wanting both symmetry and practicality, is which one of these should be chosen?
Most C-like languages use a mixture instead, breaking symmetry in favour of practicality:
I don't know man, I was indecisive for a long time. For now I just decided to not add these "inverse" operators in the language.
When comparing x and y, there are three posibilities
x < yx = yx > yWhat if you want to find the "opposite" of each of these operations?
Then there are 2 ways to express "inverse" of these primary operations:
1. Negation
Defining in terms of negation.
!(x < y)!(x = y)!(x > y)2. Relational Complement
Defining in terms of what is true instead.
x = y || x > yx < y || x > yx < y || x = yMost programming languages provide shortcut operators for these inverse operations.
Going by the first philosophy, we have:
x !< yx != yx !> yGoing by the second philosophy, we have:
x >= yx <> yx <= yThe dilemma, as someone who is designing a language wanting both symmetry and practicality, is which one of these should be chosen?
Most C-like languages use a mixture instead, breaking symmetry in favour of practicality:
x >= yx != yx <= yI don't know man, I was indecisive for a long time. For now I just decided to not add these "inverse" operators in the language.