www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Suggestion for another operator: slice assign

I find myself doing the following sometimes:

   T[] array = <something>;
   if(<whatever) {
     Process(array[0]);
     array = array[1..length];
   }

Which made me think that a slice-assign operator would make a lot of 
sense; it would be a good parallel with += *= and the rest.  What I 
imagined was something like:
   array =[1..length];

Which isn't 100% consistent with the others, of course, since the 
operator comes AFTER the =, but it's close.

Thoughts?
Nov 14 2004