[Issue 3395] Ambiguous array operations

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed May 16 08:43:42 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=3395

Dmitry Olshansky <dmitry.olsh at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |dmitry.olsh at gmail.com
         Resolution|---                         |WONTFIX

--- Comment #7 from Dmitry Olshansky <dmitry.olsh at gmail.com> ---
> So the idea is to give iteration distinct syntax:
> x[*]=y[*]; //copy slice
> x[*]=a; //assign all slice items
> f(x[*]); //rewritten as foreach(a;x)f(a);
> x[*]=f(y[*]); //foreach(i,ref a;x)a=f(y[i]);
> x[*]=f(y[]); //foreach(ref a;x)a=f(y.opSlice());
> x[][][][*]=a; //x.opSlice().opSlice().opSlice()[*]=a;

This is magic, and it's for arrays only. I believe by now it's clear we want
less of it, not more.

A solid DIP might get us something here but not much.

--


More information about the Digitalmars-d-bugs mailing list