Wow, that IS quite bit surprising! It seemed to me ..< was originally meant to
be more-or-less equivalent to .. < (or maybe even an anti-typo trick?). I'm
glad I never use unary < to begin with.
@Araq I like the idea. One of my friends who's coding a hobby project in Nim
always avoids < so much that he doesn't even use ..<. Maybe depreciating <
would encourage such people? I never had an issue with that but I imagine unary
< could also potentially lead to nasty bugs with typos when using unusual bool
operators, consider:
let x = -7
let arr = [-1, 0, 1]
echo arr[(int)(-10<x) + (int)(x<-5)] # 1 (arr[1])
echo arr[(int)(-10<x) + (int)(x-<5)] # error (arr[-10])
# even worse if the result is in bounds
It may look silly but one of my friends, a C coder, once typoed -= for =-
(which would never happen in Nim, hurray!) in a really simple function handling
some byte buffers.