[Bug 20631] New: [F+O 3.0] The "numeric" pseudo-type

https://www.w3.org/Bugs/Public/show_bug.cgi?id=20631

            Bug ID: 20631
           Summary: [F+O 3.0] The "numeric" pseudo-type
    Classification: Unclassified
           Product: XPath / XQuery / XSLT
           Version: Last Call drafts
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Functions and Operators 3.0
          Assignee: mike@saxonica.com
          Reporter: mike@saxonica.com
        QA Contact: public-qt-comments@w3.org

A number of functions, such as abs(), have signatures that declare the expected
type and result type as "numeric". In 4.2 we explain "The word " numeric " in
function signatures signifies these four types [that is, integer, decimal,
float, and double]."

This informal description was fine in the past, but it falls apart once we have
higher-order functions. What is the type of fn:abs#1? What happens when we
supply fn:abs#1 to a function that expects function(xs:integer) as xs:double?
We don't say.

With the work that we have done on unions, we can do better than this. We
should say that where we use "numeric" in a function signature, we mean an
anonymous type whose definition is union(xs:decimal, xs:double, xs:float). With
this definition, there is no change in functionality for callers of these
functions, but the semantics become clear for higher-order operations where the
type of the function is significant.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Thursday, 10 January 2013 12:13:44 UTC