I honestly don’t know whether this should be tagged satire or not. The idea is clearly explained and I can see potential utility, but it also seems ridiculous. I didn’t submit it to answer that question, but because it’s an interesting tiny example of the tradeoff between expressivity and safety; Perl vs Python.
“Top 5 reasons why I don’t write code on line number #45”
I’ll be honest It feels really weird seeing (5 < x && 10 > x) Who put the variable on the right hand side of the “>” except for like 5 < x < 10. No wonder the author is struggling so much with confusion.
See Racket’s <.
It can (< 5 x 10).
(< 5 x 10)
Heh, due to the styling of links on lobste.rs, that reads rather hilariously as the lesser or equal sign.
Also Common Lisp, Elisp, and Clojure. It’s an incredibly nice little thing.
Or, to move out of Lisp: also in Python.
Yup. A little tip is to read variadic < as “strictly ascending” and <= as “ascending”. That was it makes as much sense for the expected 2-arity as it does for the 0, 1, and N overloads.
This sounds more like an argument for including Python’s “l<x<r” (or “l>x>r”, or “l<=x<=r” or whatever combination) construct than an argument against greater-than. Personally, I think it’s much clearer to say “x > 10” than “10 < x”, though mixing them within a single expression is certainly, if not playing with fire, at least toying with heat.
x > 10
10 < x
this is where math also offers intervals, unfortunately with two notations https://en.wikipedia.org/wiki/Interval_%28mathematics%29#Including_or_excluding_endpoints
If this goes on, I don’t know how I should continue developing C any more. First I’m not allowed to use goto’s, now no greater than signs… /s
Or use Range in Ruby.