W3C home > Mailing lists > Public > public-qt-comments@w3.org > May 2016

[Bug 29586] [XQ31] 2.5.6.2 The judgement subtype-itemtype(Ai, Bi)

From: <bugzilla@jessica.w3.org>
Date: Tue, 10 May 2016 18:20:19 +0000
To: public-qt-comments@w3.org
Message-ID: <bug-29586-523-CyF6nIw7il@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=29586

--- Comment #13 from Jonathan Robie <jonathan.robie@gmail.com> ---
(In reply to Tim Mills from comment #8)
> I'm lobbying to allow 
> 
> function() { 1 } instance of function() as xs:integer 

I would like that.  I would like to find a simple way to do that without
breaking anything.  I don't think we have found it yet, so let's keep looking.

(In reply to Abel Braaksma from comment #11)
> I wrote in today's IRC chat that at present, at least two implementations of
> XPath (this is an XQ bug but equally applies to XP) return "true" on that
> query: Saxon and Exselt. I didn't try others.

BaseX returns true.  Tim's implementation presumably returns true.  So a lot of
implementations do.  I don't yet know where our specs permit this.  I'm happy
to be shown where, or to be shown a simple way to fix this in the specs.

> Also, it is always a safe optimization to make the return type more specific
> if you can, as anywhere the result of the function is needed, the more
> specific result is also an instance of the more generic result. I.e., this
> succeeds:
> 
> I.e., the following returns "boo true", even though $g has return type
> item().
> 
>    let $g := function() { 1 }, 
>    $f := function($h as function() as xs:decimal) { "boo" } 
>    return ($f($g), $g instance of function() as xs:integer)

But does our spec say this, or are you going by implementations?

> I think the spec already allows this.

Where does our spec allow this?

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
Received on Tuesday, 10 May 2016 18:22:15 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 10 May 2016 18:22:16 UTC