DIP 1025--Dynamic Arrays Only Shrink, Never Grow--Community Review Round 1

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Mon Nov 11 17:12:13 UTC 2019


On Monday, 11 November 2019 at 17:00:07 UTC, Steven Schveighoffer 
wrote:
> No, you are misunderstanding a lot here.

This is nitpicking.

If you are going to have a good story with interfacing with C++ 
libraries and frameworks... you don't want this to fail 
accidentally:

ownerpointer = normalize(initialize(allocate()))

Where normalize is a D function that calls other GC library code 
that is well-behaving, except the one that accidentally grows the 
slice because it works in the library-author's pure GC code.

You have to be able to call GC code even if you want to modify 
non-GC memory.


Anyway, it also isn't true that Dynamic Arrays don't have a type. 
It isn't untyped. But the typesystem it uses is completely 
different from the rest of the language.

It appears to be quasi-dynamic effects based, whereas the rest of 
the language is mostly static strongly typed. Meaning, the type 
changes as you use it. Does any other object in D do that?



More information about the Digitalmars-d mailing list