This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 3171 - [XQuery] 3.12.5 Constructor Functions
Summary: [XQuery] 3.12.5 Constructor Functions
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XPath 2.0 (show other bugs)
Version: Candidate Recommendation
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Don Chamberlin
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-01 17:07 UTC by Michael Dyck
Modified: 2006-06-13 17:35 UTC (History)
0 users

See Also:


Attachments

Description Michael Dyck 2006-05-01 17:07:27 UTC
3.12.5 Constructor Functions
"The semantics of the constructor function T($arg) are defined to be equivalent to the expression ($arg cast as T?)."

Please clarify whether this is talking about the semantics of the function or the semantics of a *call* to the function. If the former, then a call to the function has the usual call-related semantics (including the function conversion rules of section 3.1.5). If the latter, the equivalence bypasses the usual call-related semantics.

(Mind you, I haven't found a case where the two interpretations lead to different outcomes.)
Comment 1 Jerome Simeon 2006-06-12 16:59:35 UTC
Dear Michael,

The XSLT and XML Query working groups have reviewed your comment and believe that the definition of constructor functions should be clear:

<<
[Definition: The constructor function for a given type is used to convert instances of other atomic types into the given type. The semantics of the constructor function T($arg) are defined to be equivalent to the expression ($arg cast as T?).]
>>

The working groups believed that the use of the term 'equivalence' in the second sentence of the definition shouldn't leave much room for misunderstanding.

As a results the working groups have decided to close your comment with no
action.

Best regards,
- Jerome Simeon, on behalf of the XSLT and XML Query working groups

Comment 2 Michael Dyck 2006-06-12 20:38:36 UTC
I'm not satisfied by that response, as it does not address the particulars of my original comment -- specifically, the distinction between a function and a function call. From your response, I still have no idea which you actually intend. 

> The working groups believed that the use of the term 'equivalence' in the
> second sentence of the definition shouldn't leave much room for
> misunderstanding.

I strongly disagree. Sure, there's no misunderstanding that you're defining an equivalence (and I never questioned that), but there's certainly still room for misunderstanding about the things being defined as equivalent.

----

Let me try a different tack. Do you think the definition would mean the same thing if it said "the semantics of a call to the constructor function ..." ?

If you do, then consider this a request to make that change.

If you don't think it would mean the same thing, then perhaps you understand the distinction I was making in the original post.
Comment 3 Don Chamberlin 2006-06-13 16:53:59 UTC
Michael,
On June 13, 2006, the Query and XSLT working groups reconsidered this reopened comment and agreed to make the following change in Section 3.12.5 (Constructor Functions) in the next version of the XQuery specification:

"The semantics of the constructor function T($arg) are defined ..."

will be changed to 

"The semantics of the expression T($arg) are defined ..."

The working groups believe that this change addresses your issue, and accordingly I have marked this comment as Fixed and Closed. Of course, you may reopen the comment if you are not satisfied with this resolution.
Regards,
Don Chamberlin (for the Query and XSLT working groups)
Comment 4 Michael Dyck 2006-06-13 17:35:51 UTC
(In reply to comment #3)
> 
> "The semantics of the expression T($arg) are defined ..."
> 
> The working groups believe that this change addresses your issue,

Yup, thanks.

However, since you don't want to restrict the equivalence to expressions in which the argument is a variable reference, I suggest you change '$arg' to 'ExprSingle'. And put parentheses around the argument in the cast expression, since it isn't necessarily a UnaryExpr.