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 24200 - '"as" SequenceType' vs 'TypeDeclaration' in XPath/XQuery 3.0?
Summary: '"as" SequenceType' vs 'TypeDeclaration' in XPath/XQuery 3.0?
Status: RESOLVED WONTFIX
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XPath 3.0 (show other bugs)
Version: Proposed Recommendation
Hardware: All All
: P2 trivial
Target Milestone: ---
Assignee: Jonathan Robie
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-03 13:08 UTC by Tony Graham
Modified: 2014-01-07 18:36 UTC (History)
2 users (show)

See Also:


Attachments

Description Tony Graham 2014-01-03 13:08:35 UTC
Is it an omission that in XPath 3.0 [1], '"as" SequenceType' appears in production [64] whereas 'TypeDeclaration' appears in production [3], where 'TypeDeclaration' is defined as '"as" SequenceType' in production [66]?

[64] InlineFunctionExpr ::= "function" "(" ParamList? ")" ("as"
SequenceType)? FunctionBody
[2] ParamList ::= Param ("," Param)*
[3] Param ::= "$" EQName TypeDeclaration?
[66] TypeDeclaration ::= "as" SequenceType

XQuery 3.0 [2] similarly uses '"as" SequenceType' in its production [165] while making rather more uses of 'TypeDeclaration' in other productions.

[1] http://www.w3.org/TR/xpath-30/
[2] http://www.w3.org/TR/xquery-30/#id-inline-func
[3] http://www.w3.org/TR/xpath-30/#prod-xpath30-Param
[64] http://www.w3.org/TR/xpath-30/#prod-xpath30-InlineFunctionExpr
[66] http://www.w3.org/TR/xpath-30/#prod-xpath30-TypeDeclaration
[165] http://www.w3.org/TR/xquery-30/#prod-xquery30-InlineFunctionExpr
Comment 1 Jonathan Robie 2014-01-07 16:39:39 UTC
This is editorial. While I agree that it would be nice to make the two specs editorially consistent in the names of productions, the grammars are equivalent, and I would rather not change the grammar in a PR.

I propose to fix this in 3.1.
Comment 2 Michael Kay 2014-01-07 17:05:06 UTC
(Jonathan perhaps failed to make it clear that his response is given after WG discussion and decision. The machinery for generating the grammars used in our specs is quite complex and refactoring can have unexpected consequences, so we felt that this change was too high risk to make at this stage of the game).
Comment 3 Michael Dyck 2014-01-07 18:36:27 UTC
It looks like we use 'TypeDeclaration' when specifying the type of a variable or parameter, and 'as SequenceType' when specifying the return type of a function or function-type. I think it would look somewhat odd (possibly confusing) to replace 'as SequenceType' with 'TypeDeclaration' in the latter productions.

So, to answer the initial question, I suspect it's not an omission (or oversight) that 'TypeDeclaration' isn't used everywhere it could be. And I'm inclined to think it doesn't need "fixing" in 3.1.