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 1381 - [XQuery] some editorial comments on A.1.1 grammar-note: reserved-function-names
Summary: [XQuery] some editorial comments on A.1.1 grammar-note: reserved-function-names
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 1.0 (show other bugs)
Version: Last Call drafts
Hardware: All All
: P2 minor
Target Milestone: ---
Assignee: Scott Boag
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard: grammar
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-11 07:33 UTC by Michael Dyck
Modified: 2007-02-25 23:52 UTC (History)
0 users

See Also:


Attachments

Description Michael Dyck 2005-05-11 07:33:44 UTC
A.1.1 grammar-note: reserved-function-names

[See a later comment for suggested alternate wording.]

"Some unprefixed function names may be confused by the parser"
    Using the usual spec-y interpretation of "may", this means that parsers are
    allowed to be confused! Instead, maybe:
        Parsers could be confused if we allowed unprefixed function names with
        the same spelling as some keywords.

"function name invocation"
    Change to "FunctionCall".

"an incomplete IfExpr"
    Maybe change to "the start of an IfExpr". (Otherwise someone might say, "But
    an incomplete IfExpr is illegal.")

(alternative?)
    In leading-lone-slash, you gave an easy way to construct a semantically
    equivalent query. How about for this?  I think there's no local 'fix' --
    you have to either rename the function, or else use a prefixed name, which
    could involve binding the namespace to a prefix.
Comment 1 C. M. Sperberg-McQueen 2005-07-07 03:12:03 UTC
I think the point about the parser is well taken.  Here is 
a candidate rewording:

   Unprefixed function names spelled the same way as language
   keywords could make the language harder to recognize.  For
   instance, "if(foo)" could be taken either as a FunctionCall or
   as the beginning of an IfExpr.  Therefore it is not legal
   syntax for a user to invoke functions with unprefixed names
   which match any of the names in A.3 Reserved Function Names.

   A function named "if" can be called by binding its namespace
   to a prefix and using the prefixed form:  "library:if(foo)"
   instead of "if(foo)".

[Alternatively, "Therefore functions with local names matching
... MUST be invoked in a prefixed form, not in an unprefixed
form."]

[Optionally show parse trees from proposal in bug 1390.]
Comment 2 Scott Boag 2005-07-09 05:09:27 UTC
(In reply to comment #1)
> I think the point about the parser is well taken.  Here is 
> a candidate rewording:
> 
>    Unprefixed function names spelled the same way as language
>    keywords could make the language harder to recognize.  For
>    instance, "if(foo)" could be taken either as a FunctionCall or
>    as the beginning of an IfExpr.  Therefore it is not legal
>    syntax for a user to invoke functions with unprefixed names
>    which match any of the names in A.3 Reserved Function Names.
> 
>    A function named "if" can be called by binding its namespace
>    to a prefix and using the prefixed form:  "library:if(foo)"
>    instead of "if(foo)".

Adapted.

> [Optionally show parse trees from proposal in bug 1390.]
> 

No, I don't want to start showing parse trees in the spec.

Comment 3 Scott Boag 2005-07-22 19:36:20 UTC
A joint meeting of the Query and XSLT working groups considered this comment on 
July 20, 2005.  

The WGs agreed to resolve these editorial issues as listed in my previous comment.

If you do not agree with this resolution, please add a comment explaining why.
If you wish to appeal the WG's decision to the Director, then change the Status
of the record to Reopened. If we do not hear from you in the next two weeks, we
will assume you agree with the WG decision.
Comment 4 Jim Melton 2007-02-25 23:52:36 UTC
Closing bug because commenter has not objected to the resolution posted and more than two weeks have passed.