D needs a type expression syntax
Walter Bright
newshound2 at digitalmars.com
Sun May 7 00:16:50 UTC 2023
On 5/6/2023 8:55 AM, Quirin Schroll wrote:
> For the record: I’ve objected to parentheses for tuples from the beginning.
> Parentheses are for grouping, not for constructing. My take on the tuples front
> was to look at static arrays as the special case of tuples that are homogeneous
> (the same type iterated), and generalize them for heterogeneous components:
> `int[2]` is a shorthand for `[int, int]`; and `[int, string]` is a heterogeneous
> tuple. You build such a tuple like you build an array: `[1, "abc"]`. Indexing
> with a run-time index is supported by Design by Introspection: A `[int,
> immutable int]` can give you `ref const(int)` access, a `[int, long]` can give
> you `long` access by value, but no `ref` access.
I'd like Timon Gehr to weigh in on this!
More information about the Digitalmars-d
mailing list