why static array can be reassigned with new allocation?
Tejas
notrealemail at gmail.com
Sat Oct 15 16:49:36 UTC 2022
On Saturday, 15 October 2022 at 16:20:51 UTC, mw wrote:
> On Friday, 14 October 2022 at 19:46:06 UTC, jfondren wrote:
>> [...]
>
> This is so confusing, we should have two different syntax for
> this two different semantics:
> ```
> arr = other; // assign array variable to `other`
>
> arr[] = other[]; // assign array contents
> ```
>
> I think D has the second form already, then the first form
> should not be a shorthand for the second form.
>
> These two have two different semantics.
>
> If you view the above two statements as in Python (numpy), it's
> very clear their meaning are different:
> ``` Python
> arr = other; // assign array variable to `other`
>
> arr[:] = other[:]; // assign array contents
> ```
+1
More information about the Digitalmars-d
mailing list