metaeducation / rebol-issues

6 stars 1 forks source link

LESSER-OR-EQUAL? doesn't exist (but GREATER-OR-EQUAL? does) #2518

Closed BlackATTR closed 3 years ago

BlackATTR commented 3 years ago

I'm trying to avoid the infix of statements like <value!> >= <value!> and <value!> <= <value!> so I can more easily reduce and evaluate them properly inside an ALL [...].

In the process, I noticed that while there is a GREATER-OR-EQUAL?, there appears to be no LESSER-OR-EQUAL?.

hostilefork commented 3 years ago

I believe this was a by-product of a conceptual experiment in trying to establish >= and =< as the pairing.

Hence it was named equal-or-lesser? to be in = < order, instead of lesser-or-equal? which implies an order that looks like an arrow, e.g. <=.

The campaign to retake <= for a leftward arrow has basically been given up, but it seems this little-used routine still has the naming from that time.

hostilefork commented 3 years ago

So I've added more aliases for LESSER-OR-EQUAL? and EQUAL-OR-GREATER?, in line with the belief that there's no reason why <= needs to be "less than or equal" instead of an arrow that doesn't also apply to why => needs to be "equal or greater" instead of an arrow.

https://github.com/metaeducation/ren-c/commit/d7bd7c34bd232155f0032f1e811b7d4b993fecfe

We abide by this by not defining => differently either (hence lambda is now -> for this and other reasons) . So if => is to be interpreted as an arrow, it would be in a dialect that could also interpret <= as an arrow.

However since all aliases are still present, any code written to use EQUAL-OR-LESSER? will continue to work... as I feel =< is the "true" choice of comparison operator that we would make if starting from scratch...which would free us to get people to see <= as an arrow.