www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Request - opSliceAssign()

reply Arcane Jill <Arcane_member pathlink.com> writes:
I humbly request that opIndex(int i, int value) be renamed as opIndexAssign(int
i, int value), for consistency with the other assigning operator overloads. It
says "The names of the overloaded operators may change" in the manual, so you've
already covered yourself there.

I also request that you add the new operator opSliceAssign(int i, int j, T
value),
to overload x[i..j] = value;

Jill
Jun 03 2004
next sibling parent "Matthew" <matthew.hat stlsoft.dot.org> writes:
Gets my vote

"Arcane Jill" <Arcane_member pathlink.com> wrote in message
news:c9mkoo$1pks$1 digitaldaemon.com...
 I humbly request that opIndex(int i, int value) be renamed as opIndexAssign(int
 i, int value), for consistency with the other assigning operator overloads. It
 says "The names of the overloaded operators may change" in the manual, so
you've
 already covered yourself there.

 I also request that you add the new operator opSliceAssign(int i, int j, T
 value),
 to overload x[i..j] = value;

 Jill
Jun 04 2004
prev sibling parent Norbert Nemec <Norbert.Nemec gmx.de> writes:
Arcane Jill wrote:

 
 I humbly request that opIndex(int i, int value) be renamed as
 opIndexAssign(int i, int value), for consistency with the other assigning
 operator overloads. It says "The names of the overloaded operators may
 change" in the manual, so you've already covered yourself there.
 
 I also request that you add the new operator opSliceAssign(int i, int j, T
 value),
 to overload x[i..j] = value;
 
 Jill
I agree. Especially, since opIndex(int i, int value) cannot be extended to multiple dimensions in the future. Anyhow: I would really like to see an idea, how would generalize opSlice for more dimensions and striding capabilities. Making x[i1..j1:s1,i2..j2:s2] execute something like opSlice(int i1,int j1,int s1,int i2,int j2,int s2) seems a bit messy to me. Any ideas?
Jun 07 2004