Happy Happy Joy Joy (was: On to Hydro)
Mark S. Miller
Mon, 21 Aug 2000 14:42:54 -0700
At 01:32 PM 8/21/00 , Tyler Close wrote:
>? define m := RedBlackTree new(LesserDouble INSTANCE) asSet
># value: [ ]
>? define NaN := 0.0 / 0.0
># value: NaN
>? m := m with(NaN)
># value: [ NaN ]
Since RedBlackTrees are supposed to only hold fully ordered sets, I propose
that this operation should be an error. I hereby define ;) a singleton set
of an irreflexive element to be a non fully ordered set. Makes for a
different sort of weird sense. Of course, for a non-ordering container
there's no such issue.
>? m contains(NaN)
># value: false
Likewise, a non ordering container would say true, since it would use "=="
rather than "<=>".
A case that's weird in the other direction:
? m := m with(0.0)
# value: [0.0]
? m contains(-0.0)
# value: true
Whereas a non ordering container would say false.