Named Arguments Status Update - Empty Tuple Value

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Tue Jan 9 03:44:53 UTC 2024


On 09/01/2024 12:52 PM, Walter Bright wrote:
> My intuition says that an empty tuple is nothing at all, and should just 
> be elided from consideration. Trying to assign nothing to parameter |y| 
> doesn't make sense, and it should error.
> 
> In fact, trying to assign a tuple to |y| that is anything other than one 
> element should be an error.
> 
> Timon knows more about tuples than I do, so his input would be most welcome.

In type theory a tuple can be:

1. A distinct type, it is an object, it is not a sum of its elements.
2. Is not a distinct type, it is not an object, it is the sum of its 
elements.
3. Can have named elements.
4. Cannot have named elements.
5. An element can be a type.

Everything boils down to tuples, they are whatever a person needs it to 
be when doing the analysis.

What we have now with alias sequences are not representative of tuples, 
although they are a subset of tuples.


More information about the Digitalmars-d mailing list