W3C home > Mailing lists > Public > public-qt-comments@w3.org > July 2005

[Bug 1709] New: [FS] (editorial) recommendation for static typing extensions

From: <bugzilla@wiggum.w3.org>
Date: Mon, 18 Jul 2005 07:23:49 +0000
To: public-qt-comments@w3.org
Message-Id: <E1DuPyf-0002rk-2A@wiggum.w3.org>


           Summary: [FS] (editorial) recommendation for static typing
           Product: XPath / XQuery / XSLT
           Version: Last Call drafts
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P4
         Component: Formal Semantics
        AssignedTo: simeon@us.ibm.com
        ReportedBy: dflorescu@mac.com
         QAContact: public-qt-comments@w3.org

In 6.1 Static Typing Extensions, the FS specification states the following:

"It is not recommended for a static typing extension to change the
static typing behavior of expressions that specify a type explicitely
 (treat as, cast as, typeswitch, function parameters, and type
declarations in variable bindings), since the purpose of those 
expressions is to impose a specific type."

This kind of recommendation is not appropriate for a standard specification.
In fact, many desirable static typing extensions will violate this recommendation.
This is likely to happen if the specified type is a supertype of the static type result. 

Consider the following example:

declare function local:f($x as xs:decimal) as item* {$x};

The static type analysis can infer that the function retun type is
xs:decimal, which is more specific than item*. So an implementation 
may correctly infer xs:decimal as the static type of local:f() 
such that that the subsequent static type analysis of addition will be OK. 
Otherwise, this query will  unnecessarily yield pessimestic type errors.
Received on Monday, 18 July 2005 07:23:53 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:45:25 UTC