February 07, 2016 Re: Does anyone care if Tuple.slice() returns by ref? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ola Fosheim Grøstad | On Sunday, 7 February 2016 at 16:49:16 UTC, Ola Fosheim Grøstad wrote:
> On Sunday, 7 February 2016 at 16:27:32 UTC, Saurabh Das wrote:
>> Why is the design flawed?
>
> Because it breaks expectations.
>
> Tuples should be builtin and the primarily use case is supporting multiple return values with heavy duty register optimization.
The fact that `Tuple` cannot implement `opIndex` or `opSlice`, but instead must use the non-standard `slice` name is a good indicator that the current design is less than ideal.
|
Copyright © 1999-2021 by the D Language Foundation