Passing dynamic arrays

Kagamin spam at here.lot
Mon Nov 8 12:09:20 PST 2010


Jens Mueller Wrote:

> I find this behavior rather strange. Arrays are neither passed by value
> (copying the whole array) nor by reference. I see reasons for doing it
> like this, e.g. doing array = array[1..$] inside should not affect the
> outside.
> But I wonder whether these semantics are well enough documented?

It may take some effort to explain it. Does it help, if you think about T[] as not an array but a slice?


More information about the Digitalmars-d mailing list