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 19:19:36 UTC 2019
On Monday, 11 November 2019 at 18:15:13 UTC, Jonathan M Davis
wrote:
> accepted or not. If the dynamic arrays are being passed around
> in a way that you don't know what their lifetimes are, then
> they need to be GC allocated.
In the Prior Work section the DIP states:
«Rust's notion of pointers owning the memory they point to,
unless the pointer is borrowed, is equivalent with this DIP's
notion of a slice "borrowing" a reference to another object which
manages the memory.»
So it does seem to imply that slices are borrowed views.
Conceptually, dynamic arrays would be borrowed from the GC, thus
you don't need to know their lifetimes.
Lifetimes would come into play for non-dynamic-arrays, I guess,
so scope... perhaps.
More information about the Digitalmars-d
mailing list