RE: Casting/constructors should accept the empty sequence

Scary, but I agree with Michael (Rys).
    Jim

At 12:26 AM 6/1/2004 Tuesday, Michael Rys wrote:

>I don't like xs:int?().
>
>
>I think using
>
>Expr cast as T
>Expr cast as T?
>
>And T(Expr) as a synonym for the later quite acceptable and do not see a
>reason to change.
>
>Best regards
>Michael
>
> > -----Original Message-----
> > From: public-qt-comments-request@w3.org [mailto:public-qt-comments-
> > request@w3.org] On Behalf Of Michael Kay
> > Sent: Sunday, May 30, 2004 3:19 PM
> > To: 'Ashok Malhotra'; Michael Rys; 'Ashok Malhotra'; 'Don Chamberlin'
> > Cc: public-qt-comments@w3.org
> > Subject: RE: Casting/constructors should accept the empty sequence
> >
> >
> > Here is an out-of-the-box suggestion.  Remove the verbose cast syntax.
> > Allow two signatures for each constructor function;
> >
> >       one that accepts the empty sequence and one that does not.  For
> > example:
> >
> >       xs:integer(anyAtomicType)
> >
> >       xs:integer?(anyAtomicType?)
> >
> >       The only problem with this suggestion is that you will not be
>able
> > to cast/construct user defined datatypes defined in the null namespace
> >
> >       if the null namespace is used as the default namespace for
> > functions.
> >
> >
> > I quite like this.
> >
> > We could solve the "null namespace" problem by changing the XPath
>grammar
> > so
> > that wherever it currently uses the QName production, it is changed to
>use
> > a
> > new construct NQName, where NQName allows either a lexical QName, or
> > ":name"
> > to refer to the expanded QName that has local part "name" and is in
>the
> > null
> > namespace. (We could encourage XML and XMLSchema to adopt the same
> > convention where they use QNames, but we could do it for XPath QNames
> > independently).
> >
> > Extending the syntax of function calls to allow xs:int?(3) is a bit
> > tricky,
> > and the effects might be a little pervasive. We could define it as
>custom
> > syntax, however. In fact, we could then make the parens optional,
>allowing
> > xs:int? 3
> >
> > Michael Kay
> >
> >
> >
> >
> >
> >

========================================================================
Jim Melton --- Editor of ISO/IEC 9075-* (SQL)     Phone: +1.801.942.0144
Oracle Corporation        Oracle Email: jim dot melton at oracle dot com
1930 Viscounti Drive      Standards email: jim dot melton at acm dot org
Sandy, UT 84093-1063              Personal email: jim at melton dot name
USA                                                Fax : +1.801.942.3345
========================================================================
=  Facts are facts.  However, any opinions expressed are the opinions  =
=  only of myself and may or may not reflect the opinions of anybody   =
=  else with whom I may or may not have discussed the issues at hand.  =
======================================================================== 

Received on Tuesday, 8 June 2004 20:32:05 UTC