On Thu, 14 Aug 2014 06:46:40 +0000
Andrew Godfrey via Digitalmars-d <digitalmars-d@puremagic.com> wrote:

sorry for the late answer.

> Don't think I'm being flippant, but I have trouble interpreting 
> such feedback, because D's dynamic array semantics ARE 
> complicated.
and it will be even more complicated if we will rename 'em to 'array
references'.

i completely agree that D dynarray docs can be made clearer and i
appreciate any efforts which makes docs better. i'm just against
'reference' term -- seems that i'm from that minority that becomes
immediately confused when reading 'array reference'. what i expect from
'reference' is that this code works:

  void foo (int[] a) {
    a ~= 42;
  }
  ...
  int[] arr;
  arr ~= 666;
  foo(arr);
  assert(arr.length == 1 && arr[0] == 42);

but it doesn't. so arrays clearly aren't 'references' (as 'reference',
to my opinion, should keep 'pass by reference' semantics in this case).

so maybe we should coin some new word to describe dynarrays in D.

Attachment: signature.asc
Description: PGP signature

Reply via email to