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

DLearner bmqazwsx123 at gmail.com
Tue Nov 29 18:59:46 UTC 2022


To me, it appears that there are really two (_entirely separate_) 
concepts:

A. Supporting the useful concept of variable length (but 
otherwise entirely conventional) arrays;
B. Supporting a language feature that acts as a window to an 
array, through which that array can be manipulated.

And currently these two concepts are combined.

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?



More information about the Digitalmars-d-learn mailing list