Flat multi-dim arrays.

Dave Dave_member at pathlink.com
Thu Aug 10 11:51:38 PDT 2006


Ivan Senji wrote:
> Dave wrote:
>>
>> What, not even a "that sucks!" from someone <g>
> 
> OK, here's one: "that sucks!"
> 

<g> Thanks! Sometimes silence is not golden <g>

> I really miss this feature. Like Don said Norbert Nemec wrote a proposal 
> quite a long time ago and I don't think it was that bad, nothing that 
> Walter couldn't fix himself if he really wanted to get the feature in 
> the language. If I remember correctly there was also a version 
> rectangular array class that Ben wrote that could do strides and all the 
> other cool stuff (if I remember correctly :))
> 

I'll check that out too. IMHO, this is something that needs to be built in (and not just a template 
hack or something like that in the background) for speed reasons. If a new, expanded struct (like 
Array) is introduced, then we have slow function parameter passing and maybe more cache issues, etc. 
So the trick as I see it is to try and make it usable w/ the current compiler internals at least for 
phase 1 (not version 1 of D, phase 1 of MD arrays ;)).

>>
>> I'm pretty sure the syntax has been proposed before, but not the same 
>> implementation ideas.
>>
>> I for one would like syntax like this. I like it w/ C#, and it seems a 
>> relatively low hanging and juicy fruit (but Walter would have to tell 
>> us how low hanging it is for sure, of course).
> 
> Me too, been missing rectangular arrays in D from the very beginning 
> because they are an extremely useful data type.
> 
> D's rectangular arrays just suck, with their lengths being compile time 
> constants, and not to mention other problems with static arrays.

Totally agree - I bet they are one of the least used features of D right now.



More information about the Digitalmars-d mailing list