[Issue 3971] Syntax & semantics for array assigns

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat May 1 22:08:31 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=3971



--- Comment #10 from Don <clugdbug at yahoo.com.au> 2010-05-01 22:08:28 PDT ---
(In reply to comment #9)
> > internally the compiler doesn't distinguish between  x[] and x, where x is a
> > dynamic array.
> This means, that array ops are a huge hack?

No. According to the spec, it's not supposed to. x[] is exactly the same as x.
The [] is only required for lvalues. So
int [4] a, b, c;
a[] =  b + c; // should work
It's almost as if there's a []= operator.
At the moment, though, a[] = b+c; fails, and you need to write a[] = b[]+c[].

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list