- From: Michael Rys <mrys@microsoft.com>
- Date: Tue, 2 Dec 2003 16:51:05 -0800
- To: "David Carlisle" <davidc@nag.co.uk>
- Cc: <dnovatchev@yahoo.com>, <public-qt-comments@w3.org>
> -----Original Message----- > From: David Carlisle [mailto:davidc@nag.co.uk] > Sent: Tuesday, December 02, 2003 4:28 PM > To: Michael Rys > Cc: dnovatchev@yahoo.com; public-qt-comments@w3.org > Subject: RE: [XQuery] static typing of node comparisons > > > > Actually the spec writer did not get it wrong. They decided to write the > > queries to work with dynamic semantics and not necessarily with the > > static semantics. The reason is that the static semantics is defined in > > the formal semantics spec. > > Ah yes returning to the original comment:-) > > I considered that as a possibility before my original post but rejected > it as being improbable and a bad choice if it really was deliberate. > I may not like it but as currently written the static typing rules are > a formal (if optional) part of the language (whichever document they get > defined in) the example code is given and states conditions under which > it will error, including reference to a code for a static error, those > conditions are incorrect if the static typing option is being used and > the text should say that. [Michael Rys] Agreed. > > The functions that take double are taking double mainly because of > > XPath 1.0 backwards-compatibility. > > yes and no. Xpath1 only had one numeric type. Xpath2 has lots, > The functions could have been typed with their natural type > (integer or even positiveinteger arguments) and still retained > operational compatibility with xpath1 if the Xpath2 type inference made > these types in any way usable, however it doesn't. If these functions > are given their natural signatures they are unusable without users using > explicit casts on the arguments to every function call. So in F&O you > have tried to dodge the issue by fudging the signatures to get usable > behaviour. This isn't really related to Xpath1 compatibility, as I said > every Xpath2 user is going to have to quickly learn to use very general > types or double (to use numeric type promotion) to avoid the draconian > static typing rules. [Michael Rys] Actually the rule that you cannot pass a double if you expect an integer is a general typing rule not related to static typing. And yes, there were a couple of choices to define a backwards-compatible way and we chose to use xs:double with promotion decimal->float->double. > David
Received on Tuesday, 2 December 2003 19:51:09 UTC