3.1 Virtual patterns

A virtual pattern is a partial specification of a pattern and the pattern may be further specified/extended in subpatterns of the enclosing pattern containing the declaration.

PatternSignature:< super
   Item1
   Item2
   ...
   Itemn

where n >= 0. The symbol ':<' specifies that the pattern is virtual.

further binding may be specified as:

PatternSignature::< super
   Item1
   Item2
   ...
   Itemn

there n >= 0. The symbol '::<' specifies that the pattern is a further binding. The pattern must be a virtual pattern in the super pattern of the pattern containing the further binding. A further binding specifies that the description of the virtual pattern is extended. The pattern is still virtual and may be extended in subpatterns of he enclosing pattern.

final binding may be specified as:

PatternSignature:: super
   Item1
   Item2
   ...
   Itemn

there n >= 0. The symbol '::' specifies that the pattern is a further binding. The pattern must be a virtual pattern in the super pattern of the pattern containing the further binding. A final binding specifies that the description of the virtual pattern is extended. The pattern is no longer virtual and may not be extended in subpatterns of he enclosing pattern.

Examples

To be done …

Grammar

<Pattern-Declaration> ::= <Virtual-Pattern-Declaration>
                       |  <Furher-Binding-Declaration>
                       |  <Final-Binding-Declaration>
<Virtual-Pattern-Declaration> ::= <Signature> ':<' <ObjectDescriptor>
<Furher-Binding-Declaration> ::= <Signature> '::<' <ObjectDescriptor>
<Final-Binding-Declaration> ::= <Signature> '::' <ObjectDescriptor>

The semantics of virtual patterns is the same as in Beta. However, the rules for parameters in qBeta differs from Beta. The exact semantics has not yet been decided, but various alternatives are being considered.

Note

There is an implementation issue regarding simple values (like Integer) versus objects (like Person).

Hello world