In adding range=?, it's necessary to decide on the semantics of range
equality. An attempt follows. Consider the two-range case for
simplicity:
(range=? equal ra rb)
If ra and rb both have zero length, the result is #t. Otherwise, the
result is #t iff their lengths are equal and their elements are
pairwise equal in the sense of EQUAL.
These semantics would equate some ranges which are internally
different, e.g.:
(range=? = (numeric-range 0 4) (vector->range #(0 1 2 3)))
; => #t
(range=? = (numeric-range 0 0)
(range 0 (lambda (i) (integer->char (+ i 65)))))
; => #t
The second example is slightly surprising, since the range have
different types (loosely speaking). In essence, these semantics
identify all empty ranges with the same object, which seems like the
Right and Schemely Thing here. Comments?
--
Wolfgang Corcoran-Mathe <xxxxxx@sigwinch.xyz>
"In these days the angel of topology and the devil of abstract algebra
fight for the soul of each individual mathematical domain."
--Hermann Weyl