[Issue 3188] remove opIndexAssign from the language

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jul 17 13:19:32 PDT 2009


http://d.puremagic.com/issues/show_bug.cgi?id=3188





--- Comment #5 from Kyle Foley <k-foley at onu.edu>  2009-07-17 13:19:31 PDT ---
(In reply to comment #3)
> Welcome to D.

Thank you :)

> In the same way, the existence of
> opIndexAssign does nothing whatsoever to prevent the compiler from expanding it
> to something else instead if the type in question has no opIndexAssign.

What else could it be?

> > I am under the impression that opIndexAssign is there only because 
> > return by reference was not available at the time of designing 
> > operator overloads. 
> 
> That's one reason.  The other reason is that it can do many things that a ref
> return can't, such as
> - converting the value to an internal representation
> - validating the set value
> - calling some external API to set the value
> - triggering side effects beyond setting the value in memory
> 
> It's the exact same reason that we have properties.

But properties are not operators.  If opIndexAssign must exist, then why
doesn't, for example, opStarAssign also exist?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list