Just got through debugging a line of code which uses dynamic array. It boiled to to my use of []. How should I "D think" about slice[]? The run time error seems to say the the length of [] is zero. I was assuming that [] meant "the entirety" of the array.

In short, is there anytime that one would want to use "slice[] = something" syntax?I

//waste[] = waste[0..$-1]; // object.Error@(0): Array lengths don't match for copy: 0 != 1

    waste = waste[0..$-1]; // works



Reply via email to