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

Vladimir Panteleev thecybershadow.lists at gmail.com
Wed Nov 30 00:46:01 UTC 2022


On Wednesday, 30 November 2022 at 00:40:57 UTC, Vladimir 
Panteleev wrote:
> 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.

Cool page explaining this in The Rustonomicon:
https://doc.rust-lang.org/nomicon/exotic-sizes.html



More information about the Digitalmars-d-learn mailing list