Top 5

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri Oct 10 06:48:49 PDT 2008


Steven Schveighoffer wrote:
> "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 

new T[x] is a brain-dead syntax that I wish Walter hadn't imported in 
the first place.

Andrei



More information about the Digitalmars-d mailing list