Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Pair comparison (was: native? :==)

From: hallvard::ystad::helpinhand::com at: 5-Feb-2002 9:13

Dixit [holger--rebol--com] (23.03 04.02.2002):
>Yes, but for string and block series there is a natural order >(left-to-right). For pairs there is not. Do you want x or y to >take precedence ?
Precedence or not, when presenting X/Y coordinates, I have yet to meet with someone who places the Y before the X (ever heard about Y/X coordinates?). [...]
>Joel Neely: >> Since "first" and "second" are just as defined for pair data as for >> tuple and string, it seem that (in the absence of a compelling >> alternative meaning for comparing pairs) maintaining consistency >> with comparison of other data types would be A Good Thing. > >Holger: >So you are arguing to give x precedence over y ? In layout-oriented >calculations y tends to be dominant though...
What tends to be dominant doesn't prevent rebol from persuing it's left-to-right ordering in other cases. E.g. most programming languages evaluate 4 + 4 * 4 to 20, rebol evaluates it to 32, unless you add parentheses. So in my opinion, one could defend the use of simple left-to-right order comparison also for pairs. ...but I'm just a Bear of Very Little Brain... ~H