3 ms·
I wonder how many other languages have well-known secret operators? I know of C's secret "limit" operator: int x = 10; while (x --> 0) { printf("%i", x); } p
by red_admiral 11y ago
I wonder how many other languages have well-known secret operators?
I know of C's secret "limit" operator:
int x = 10;
while (x --> 0) { printf("%i", x); }
prints 9876543210
Of course, in some ML dialects you can define your own opreators - such as (f |> g) to mean (g o f) which is actually very useful.
- byroot 11y agoThat's not an operator, it's just precedence rules. while ((x--) > 0)
- philh 11y agoNone of these secret operators are actual operators. (Some of them aren't even collections of operators - }{ is a form of code injection, and the <<m=~m>> thing has only one operator, applied to a string and a regex.)