Setting array length to 0 discards reserved allocation?

Dominikus Dittes Scherkl via Digitalmars-d digitalmars-d at puremagic.com
Tue Jul 29 23:11:57 PDT 2014


On Wednesday, 30 July 2014 at 05:55:58 UTC, Jonathan M Davis 
wrote:
> I'm completely opposed to changing the official terminology.
Why?

What buys it, to have two terms "slice" and "dynamic array" if 
they mean exactly the same thing?
Especially if we have two different things, the memory and the 
reference to the memory, but both terms are only adressin the 
second thing.
I would prefer to have one term meaning the one thing and the 
other term meaning the other thing.
Words are changing meaning over the years, and I think it is very 
instructive to use "dynamic array" to mean the memory, and 
"slice" to mean the reference to the memory - as done in the 
article. May be that was not the original meaning of those terms 
but it is useful, instructive and unambigous, so it should go in 
the official terminology. (otherwise we would need a new, third 
term to describe the "other thing" that is not directly 
accessible in the current language spec wording - but we have 
none and it would only increase the confusion).


More information about the Digitalmars-d mailing list