Re: [xsl] Seemingly incorrect example of function subtyping in XDM 3.0

Subject: Re: [xsl] Seemingly incorrect example of function subtyping in XDM 3.0
From: "Vladimir Nesterovsky" <vladimir@xxxxxxxxxxxxxxxxxxxx>
Date: Wed, 26 Feb 2014 01:54:57 -0800
I think it's better to use term covariance.
It exaclty describes the effect.

See
http://en.wikipedia.org/wiki/Covariance_and_contravariance_(computer_science)
--
Vladimir Nesterovsky
http://www.nesterovsky-bros.com

-------- Original Message --------
> From: "Michael Kay" <mike@xxxxxxxxxxxx>
> Sent: WWW W(WWW"W 26 W$WW(WWW( 2014 11:22
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re: [xsl] Seemingly incorrect example of function subtyping in XDM
3.0
>
> I believe the example is correct.
>
> I find it useful to think of "substitutability" rather than subtyping.
>
> If the requirement is for a function that accepts a string as an argument,
then it's OK to supply a function that accepts any item as an argument. So
function(item()) is substitutable for function(xs:string).
>
> Michael Kay
> Saxonica
>
>
> On 26 Feb 2014, at 05:45, Dimitre Novatchev <dnovatchev@xxxxxxxxx> wrote:
>
> > In the W3C XDM 3.0 Proposed recommendation at the end of section:
> > "2.8.1 Functions"
(http://www.w3.org/TR/xpath-datamodel-30/#function-items)
> >
> > the last example says:
> >
> >    "function(item()) as item() is a subtype of function(xs:string) as
item()"
> >
> > I believe that the correct statement is:
> >
> >
> >    "function(xs:string) as item()     is a subtype of
> > function(item()) as item() "
> >
> > Could someone, please, confirm whether the example in the XDM 3.0 Spec
> > is correct, and if yes, then what is the chain of rules that leads to
> > this statement?
> >
> >
> > --
> > Cheers,
> > Dimitre Novatchev
> > ---------------------------------------
> > Truly great madness cannot be achieved without significant intelligence.
> > ---------------------------------------
> > To invent, you need a good imagination and a pile of junk
> > -------------------------------------
> > Never fight an inanimate object
> > -------------------------------------
> > To avoid situations in which you might make mistakes may be the
> > biggest mistake of all
> > ------------------------------------
> > Quality means doing it right when no one is looking.
> > -------------------------------------
> > You've achieved success in your field when you don't know whether what
> > you're doing is work or play
> > -------------------------------------
> > To achieve the impossible dream, try going to sleep.
> > -------------------------------------
> > Facts do not cease to exist because they are ignored.
> > -------------------------------------
> > Typing monkeys will write all Shakespeare's works in 200yrs.Will they
> > write all patents, too? :)
> > -------------------------------------
> > I finally figured out the only reason to be alive is to enjoy it.

Current Thread