Email list hosting service & mailing list manager

range=? Wolfgang Corcoran-Mathe (01 Sep 2020 17:26 UTC)
Re: range=? John Cowan (01 Sep 2020 17:28 UTC)
Re: range=? Marc Nieper-Wißkirchen (01 Sep 2020 17:30 UTC)

range=? Wolfgang Corcoran-Mathe 01 Sep 2020 17:24 UTC

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