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

[Bug 1677] New: [FS] editorial: 4.12.2 Typeswitch

From: <bugzilla@wiggum.w3.org>
Date: Sun, 17 Jul 2005 07:42:15 +0000
To: public-qt-comments@w3.org
Message-Id: <E1Du3mx-000141-29@wiggum.w3.org>


           Summary: [FS] editorial: 4.12.2 Typeswitch
           Product: XPath / XQuery / XSLT
           Version: Last Call drafts
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Formal Semantics
        AssignedTo: simeon@us.ibm.com
        ReportedBy: jmdyck@ibiblio.org
         QAContact: public-qt-comments@w3.org

4.12.2 Typeswitch


"This variable is optional in [XPath/XQuery] but mandatory in the
[XPath/XQuery] Core."
    Not according to the Core Grammar.

"One of the reasons for having this variable is that it is assigned a
specific type for the corresponding branch."
    Is this a reason for requiring the variables in the Core, or a reason
    for someone to use them in XQuery? If the former, I don't find it
    convincing. If the latter, reword and move it before the preceding
    sentence, so it isn't mistaken for the former.

Core Grammar
    I guess you should make the $VarNames mandatory, if that's what you

"The following normalization rule adds a newly created variable that does
not appear in the rest of the query. Note that $fs:new is a newly
generated variable that must not conflict with any variables already in
scope and that is not used in any of the sub-expressions."
    These two sentences say roughly the same thing. Merge.
    Also, s/rule/rules/, as it applies to rules 1 and 3.

Notation 2

"The following auxiliary grammar production is used to identify branches
of the typeswitch."
    I don't think "identify" is the correct verb. CaseRules is a
    right-recursive restructuring of the clauses of a TypeswitchExpr.

"[79 (Formal)] CaseRules ::= ..."
    Why not use this in the actual Core grammar?
    (leftover from last year, comment #111)

    I don't think 'CaseRules' is a very good name, especially in a
    document where "rule" already means something quite different.
    How about 'CaseClauses'?

"statEnv |- Type1 case CaseRules : Type"
    No, this judgment is not applied to CaseRules, but only to individual
    clauses. So, you could declare it twice, once for CaseClause and once
    for a default clause. (It would help if Core had a DefaultCaseClause.)

is used in the static of"
    Insert "semantics" after "static"?

"the given case rule yields the type Type"

"the given case rules yields the value Value2."


"the remaining case rules are evaluated order"
    Insert "in" before "order".

DEv / rule 3 / conclusion
case SequenceType VarRef # -> # case VarRef as SequenceType
leftover comment #112

"evaluation of any case rule"
Received on Sunday, 17 July 2005 07:42:16 UTC

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