RE: Is xdt:anyAtomicType itself atomic?

On Thu, 11 Nov 2004, Michael Kay wrote:

> What practical difference does it actually make whether xdt:anyAtomicType is
> an atomic type or not? 

	The issue arrose indirectly during the implementation of our
	XQuery engine.  As part of our type system (which does full
	structural typing in addition to named typing), we've defined a
	"convenience" type to the developer:

		numeric = xs:integer | xs:float | xs:double

	I'm not clear on the exact details, but a developer who does
	our run time presumeably has the type of an expression set to
	numeric for things like addition, subtraction, etc.  Of course
	at runtime, there are actual values that also have a type.  The
	developer wanted to be able to ensure that an argument to
	something that expects an atomic type really is atomic.  A
	particular value had the type numeric, so he asked:

		T.isAtomic()

	He was surprised that it returned false.  I generalized his
	case: if numeric should be considered atomic, then so should
	anyAtomicType.  Hence my question to the committee.

	We currently have anyAtomicType defined as a union and, as far
	as we can tell, it makes no difference... except in the case at
	hand.  I pointed out that he can get what he wants by instead
	doing:

		T <= anyAtomicType

	So the issue may (?) be moot.

	- Paul

Received on Thursday, 11 November 2004 02:07:48 UTC