From: Eric B. <er...@go...> - 2007-12-26 13:23:09
|
Colin Adams wrote: > OK - mystery solved. > > The function concerned is: > > XM_XPATH_ATOMIC_SORT_COMPARER.raise_non_comparable_exception I don't understand this implementation in class XM_XPATH_ATOMIC_COMPARER: ~~~~~~~~~~~~~~~~~~~~~~~~ are_comparable (an_atomic_value, another_atomic_value: XM_XPATH_ATOMIC_VALUE): BOOLEAN is -- Are `an_atomic_value' and `another_atomic_value' comparable? require first_value_not_void: an_atomic_value /= Void second_value_not: another_atomic_value /= Void do if an_atomic_value.is_untyped_atomic then Result := an_atomic_value.as_untyped_atomic.is_comparable (another_atomic_value) else if an_atomic_value.is_numeric_value then Result := an_atomic_value.as_numeric_value.is_comparable (another_atomic_value) else if an_atomic_value.is_string_value then Result := an_atomic_value.as_string_value.is_comparable (another_atomic_value) else Result := an_atomic_value.is_comparable (another_atomic_value) end end end end ~~~~~~~~~~~~~~~~~~~~~~~~ How is it different from: ~~~~~~~~~~~~~~~~~~~~~~~~ are_comparable (an_atomic_value, another_atomic_value: XM_XPATH_ATOMIC_VALUE): BOOLEAN is -- Are `an_atomic_value' and `another_atomic_value' comparable? require first_value_not_void: an_atomic_value /= Void second_value_not: another_atomic_value /= Void do Result := an_atomic_value.is_comparable (another_atomic_value) end ~~~~~~~~~~~~~~~~~~~~~~~~ -- Eric Bezault mailto:er...@go... http://www.gobosoft.com |