Top 5

Steven Schveighoffer schveiguy at yahoo.com
Fri Oct 10 06:45:39 PDT 2008


"Andrei Alexandrescu" wrote
> Sergey Gromov wrote:
>> My T[] is useful when you want to recursively split a megabyte file into 
>> a couple thousands of tokens, and then modify some of those tokens.  For 
>> that, your T[] must be lightweight, it must reference a bigger piece of 
>> data, and it must guarantee not to write anything into memory outside its 
>> boundaries.
>>
>> The Array is for appending.  It must always own its memory.  Therefore 
>> you should be able to pass it around by reference, so Array is a *class* 
>> and cannot be nearly as lightweight as T[].
>>
>> You see, many of their properties are orthogonal.  If you drop one, you 
>> lose flexibility.
>>
>>> Besides, Array!(T) is not a good name for build-in type.
>>
>> Names are placeholders here, not an actual proposal.
>
> What's wrong with making Array a library type?

What would new T[x] return?  If it returns Array!(T), then this has to be a 
compiler-aware type.

-Steve 





More information about the Digitalmars-d mailing list