D mentioned on Rust discussions site

Ali Çehreli acehreli at yahoo.com
Sat May 23 22:29:38 UTC 2020


On 5/23/20 11:46 AM, Timon Gehr wrote:> On 23.05.20 19:08, Andrei 
Alexandrescu wrote:

 >> There's no doubt in my mind that the absence of a universal "doped
 >> pointer" (pointer plus extent) built-in or standard library in C has
 >> caused innumerable problems. The fact that early C versions could not
 >> return structs by value might have contributed to that decision.
 >
 > I think they also considered it wasteful

I doubt it.

 > because lengths would often be
 > stored multiple times, for example if you have multiple arrays of the
 > same length or otherwise related lengths.

It is understandable that there are cases where the cost of that length 
variable is measurable:

* Multiple arrays,
* Having the same length,
* and they are so short that the extra length is costly

Well, then the language has other facilities to deal with it.

Ali



More information about the Digitalmars-d mailing list