Thinking about the difference between fixed and 'dynamic' arrays.

Vladimir Panteleev thecybershadow.lists at gmail.com
Wed Nov 30 00:40:57 UTC 2022


On Tuesday, 29 November 2022 at 18:59:46 UTC, DLearner wrote:
> Suggestion: it would be clearer if the two concepts were 
> separated:
> 1. Convert 'int[] VarArr;' so it produces a straightforward 
> _value-type_ variable array, called 'VarArr';
> 2. Implement a new concept 'int slice Window;' to produce an 
> object of type 'int slice', called 'Window'.
>    'Window' is a 'slice' into an int array, not an array itself 
> or even a variable.
>
> Opinions?

Yes, that's what Rust does. It has first-class variable-size 
value types, D doesn't have such a feature.

It is too late to change it in D, nor is it often useful in 
practice.



More information about the Digitalmars-d-learn mailing list