This is a list of notations and semantics I’ve wanted to use or have used in toy programming languages that I think are particularly nice but rare, and that I’d like to see in more languages. If you’re a PL dev and you fall in love with one, adopt it and let me know!
Most languages use the standard relational operators for comparisons (>
, <
, ≥
/>=
, ≤
/<=
/=<
, =
/==
/===
, ≠
/!=
//=
/<>
), but these are almost always presented as binary operators for comparing two values. Some languages (of which Python is the most notable) include “chained” comparisons like a <= b < c
, meaning a <= b and b < c
(but with b
only evaluated for its side effects once, that is, (lambda x: a <= x and x < c)(b)
). Some languages also allow unary versions of these operators, but they rarely denote anything related to comparisons. Some languages such as Haskell allow arguments to be omitted from operators via operator sections, denot