QVT 1.1 RTF Avatar
  1. OMG Issue

QVT11 — MOF QVT 1.0, 8.2.2.22, Unclear specification of Unpack notation shorthand

  • Key: QVT11-28
  • Legacy Issue Number: 12374
  • Status: closed  
  • Source: Model Driven Solutions ( Dr. Edward Willink)
  • Summary:

    Section 8.2.2.22 provides no guidance on the meaning of:

    var x:X;
    var y:Y;
    var z:Z;
    ...
    var (x:X,y,z) := self.foo();

    [If one of the variables in the left hand side, does exist ...]

    Possible interpretations

    a) x:X is always a syntactical shorthand.

    Therefore the above is a shorthand for:

    var x:X;
    var y:Y;
    var z:Z;
    ...
    var x:X; var (x,y,z) := self.foo();

    and consequently there is duplicate variable definition to be
    reported as a semantic error.

    b) x:X is a convenience type check assertion

    Therefore the above is a shorthand for:

    var x:X;
    var y:Y;
    var z:Z;
    ...
    var (x,y,z) := self.foo();

    with a successful validation of type consistency.

    c) x:X is not available as a shorthand

    Therefore the above is a syntax error.

    ------------------------------------

    Interpretations b) and c) require semantic knowledge to resolve syntactic
    sugar.

    Interpretation a) is an unambiguous syntax shorthand that could be more
    clearly
    described by:

    "The following example demonstrates a shorthand in which variables are both
    declared
    and assigned.

    var (x:X,y:Y,z) := self.foo();

    Any variable name qualified by a type name is both a declaration and an
    assignment,
    with all declarations proceding the unapack assignment.
    The above example should therefore be analyzed as:

    var x:X; var y:Y; var (x,y,z) := self.foo();"

    ---------------------------------------------------------------------

    Recommend interpretation a) with the above textual clarification.

  • Reported: QVT 1.0 — Tue, 8 Apr 2008 04:00 GMT
  • Disposition: Resolved — QVT 1.1
  • Disposition Summary:

    No Data Available

  • Updated: Fri, 6 Mar 2015 20:58 GMT