[phobos] Time to get ready for the next release

Michel Fortin michel.fortin at michelf.com
Thu Apr 21 15:57:18 PDT 2011


Le 2011-04-21 à 17:54, Robert Jacques a écrit :

> First, remember that basic assignments can be chained: x = y = 1; So a property should never return void, whether it's a setter or a getter logically.

Indeed. You'd expect the property to return the value you set to it.


> Second, there are situations where you want to be able to support:
> 
> a.prop1 =  5;
> 
> and
> 
> auto b = a.prop1(5).prop2(6);

But here you have a dilemma. To work like "x = y = 1" above, "a.prop1 = 5" should return "5". But to work with chaining, "a.prop1(5)" should return "a". How do you make that work?


-- 
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/





More information about the phobos mailing list