theodore-norvell / PLAAY

Senior Design Project PLAAY (Programming Language for Adults And Youth)
2 stars 0 forks source link

Replace DoneV with TupleV #156

Open theodore-norvell opened 6 years ago

theodore-norvell commented 6 years ago

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.

screen shot 2018-06-08 at 8 54 57

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.