On 2013-01-28 17:21, Steven Schveighoffer wrote:

I think Jacob's point is that a = b = c would lower to:

b = c;
a = b;

This is how the semantics should be. This also shows a clear complete example:

http://forum.dlang.org/thread/[email protected]?page=14#post-ke6l44:242mfh:241:40digitalmars.com

But I think it would be wasteful in the given case.  __a is already in
the register, I think actually the return __a is a noop.

In other cases, where the property value may be a large struct or
whatnot, not returning the new value from a setter would make sense.

It would be nice if the compiler made the right choice depending on
whether you returned a value from the property or not.

Then it's up to the compiler to implement them, I don't need to know the details in the optimizations it can do.

--
/Jacob Carlborg

Reply via email to