RE: Casting/constructors should accept the empty sequence

> Correct. If you expect more than a single value (such as empty): use
> xs:int?. 

My function doesn't expect more (or less) than a single value. And I am only
supplying it with a single value. So it's hard to explain to people why this
should be an error. It looks as if users will either have to write the
verbose construct f(3 cast as xs:int), or find an implementation that
doesn't do static typing.

Michael Kay


> 
> 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: Saturday, May 29, 2004 2:18 PM
> > To: 'Ashok Malhotra'; 'Don Chamberlin'; Michael Rys
> > Cc: public-qt-comments@w3.org
> > Subject: RE: Casting/constructors should accept the empty sequence
> > 
> > 
> > >
> > > Don, Michael:
> > > We discussed your comments
> > > http://lists.w3.org/Archives/Public/public-qt-comments/2004Mar
> > /0211.html and http://lists.w3.org/Archives/Public/public-qt->
> > comments/2004Mar/00891.html
> > > in San Jose and agreed to make the following changes:
> > >
> > > 1. The constructor functions should accept the empty
> > > sequence. If the empty sequence is passed to a constructor
> > > function, the empty sequence is returned.
> > >
> > 
> > I'm mildly curious about how I explain this to users of systems that
> do
> > static typing. Am I right in thinking that if you have a function
> declared
> > as:
> > 
> >    declare function f($x as xs:int) ...
> > 
> > then the call
> > 
> >    f(xs:int(3))
> > 
> > will now be a static type error?
> > 
> > Michael Kay
> > 
> > 
> 

Received on Sunday, 30 May 2004 15:04:09 UTC