[Bug 25137] New: [F+O 3.0] Identify of functions

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

            Bug ID: 25137
           Summary: [F+O 3.0] Identify of functions
           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

According to the definition in F+O 1.6.4, two function items are identical if

have the same name (or absence of a name), arity, function signature, and
closure. (Note that there is no function or operator defined in the
specification that tests whether two function items are identical.)

Although the spec claims that no reliance is placed on identity of functions,
the definition is presumably there so that it can be used elsewhere, which
means that it needs to be useful. We are trying to make use of it in XSLT (see
bug 24478) and it causes problems because under this definition, the following
two values are identical:

let $f1 := function ($x) { $x + 1 }

let $f2 := function ($x) { $x + 2 }

which in turn means that a function which returns either of these two functions
at random is considered to be deterministic.

If we want a safe definition of function identity, then I suspect the only way
to do it is as we do with node identity, that is, to base identity on the
uniqueness of the creation event that brought the function into being. That's
not a very attractive option. Another perhaps more promising approach would be
to say that the two functions must have the same implementation, where
comparison of implementations is left implementation-defined.

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

Received on Monday, 24 March 2014 16:24:42 UTC