Argumnentation against external function operator overloading is unconvincing
Steven Schveighoffer via Digitalmars-d
digitalmars-d at puremagic.com
Tue Sep 27 05:47:03 PDT 2016
On 9/25/16 9:48 AM, Jonathan M Davis via Digitalmars-d wrote:
> On Sunday, September 25, 2016 13:10:42 ZombineDev via Digitalmars-d wrote:
>> D's built-in dynamic arrays are hidden from you and you only get
>> to interact with them by referring to their elements by using
>> slices.
>
> That's a common misconception propagated by Steven's otherwise excellent
> article. As far as the official language spec goes, T[] _is_ the dynamic
> array. What backs it is irrelevant as far as that goes. It's just that if
> it's backed by the GC, then when you append to it, the GC might not have to
> allocate a new memory buffer for the array. All of the operations on a
> dynamic array work the same regardless of what backs it, and focusing on the
> memory buffer being the array risks causing you problems when you have to
> deal with dynamic arrays backed by something else.
D can call an animal that quacks, has a flat bill, and feathers a
sparrow all it wants, but it sure doesn't act like one ;)
-Steve
More information about the Digitalmars-d
mailing list