resizeable arrays: T[new]

Derek Parnell derek at psych.ward
Mon Jun 4 15:29:19 PDT 2007


On Mon, 04 Jun 2007 10:45:09 -0700, Walter Bright wrote:

>>>
>>>    T[n]   a;  // static array
>>>    T[]    b;  // dynamic array
>>>    T[new] c;  // resizeable array
>> 
>> I'd propose a different nomenclature:
>> 
>> T[n]   a;  // static array
>> T[]    b;  // (array) slice
>> T[new] c;  // dynamic array
> 
> I like "resizeable" array because it is pretty clear what it does.

I think you are quite wrong Walter. The new interpretation of 'x[]' is
almost identical to what we used to think of as a slice. And the
interpreatation of 'x[new]' is exactly what used to be known as a dynamic
array. 

Your change will effect all code immediately whereas reversing the
(changed) meaning of '[]' and '[new]' to mean 'resizable' and 'slice' will
allow coders to change their coding over time. Unless of course that's what
you are trying to do ...


-- 
Derek Parnell
Melbourne, Australia
"Justice for David Hicks!"
skype: derek.j.parnell



More information about the Digitalmars-d-announce mailing list