TupleV objects should link to 0, 2, 3, or more components. There are no tuples of length 1.
We need a new kind of expression
Tuple( exp0, exp1, ... )
that has 0 or more children, each of which is an expression. The graphical representation can be a box with a "(" at the start and a ")" at the end with "," between each adjacent pair of expressions, like this.
For a keyboard shortcut, we can use "(" to replace or engulf with a template (Tuple( ExpPH() ), (), 0, 1 ).
For semantics. If there is one operand, the Tuple expression acts as an identity function, so its value is the same as the value of its operand. It there are zero operands, the result is a 0-tuple. If there are 2 operands or more, the result is the a tuple value.
TupleV objects should link to 0, 2, 3, or more components. There are no tuples of length 1.
We need a new kind of expression Tuple( exp0, exp1, ... ) that has 0 or more children, each of which is an expression. The graphical representation can be a box with a "(" at the start and a ")" at the end with "," between each adjacent pair of expressions, like this.
For a keyboard shortcut, we can use "(" to replace or engulf with a template (Tuple( ExpPH() ), (), 0, 1 ).
For semantics. If there is one operand, the Tuple expression acts as an identity function, so its value is the same as the value of its operand. It there are zero operands, the result is a 0-tuple. If there are 2 operands or more, the result is the a tuple value.