1. 31

  2. 33

    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.

    1. 16

      Coming soon:

      “Top 5 reasons why I don’t write code on line number #45”

      1. 2

        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.

      2. 17

        See Racket’s <.

        It can (< 5 x 10).

        1. 33

          Heh, due to the styling of links on lobste.rs, that reads rather hilariously as the lesser or equal sign.

          1. 11

            Also Common Lisp, Elisp, and Clojure. It’s an incredibly nice little thing.

            1. 2

              Or, to move out of Lisp: also in Python.

            2. 5

              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.

            3. 11

              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.

              1. 4

                this is where math also offers intervals, unfortunately with two notations https://en.wikipedia.org/wiki/Interval_%28mathematics%29#Including_or_excluding_endpoints

              2. 3

                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

                1. 2

                  Or use Range in Ruby.

                  1. 1

                    #include <drat.h>