@property needed or not needed?

Maxim Fomin maxim at maxim-fomin.ru
Mon Jan 28 07:07:32 PST 2013


On Monday, 28 January 2013 at 15:05:21 UTC, Maxim Fomin wrote:
> On Monday, 28 January 2013 at 14:38:19 UTC, Dicebot wrote:
>> On Monday, 28 January 2013 at 14:28:30 UTC, Maxim Fomin wrote:
>>> On Monday, 28 January 2013 at 14:09:20 UTC, Dicebot wrote:
>>>> On Monday, 28 January 2013 at 14:00:16 UTC, Maxim Fomin 
>>>> wrote:
>>>>> Returning void instead of int in the example break 
>>>>> assignment chaining a = b = c. Besides, how such implicitly 
>>>>> defined functions may call user defined code (check input 
>>>>> validity, call events, etc.)?
>>>>
>>>> It should not if evaluating the value of (b = c) will call 
>>>> getter for b.
>>>
>>> Why getter and not setter? Expression a = b = c = d should 
>>> call getter for d and setter for rest of them. And if c 
>>> setter returns void the chain breaks.
>>
>> "a = b" calls setter
>
> Agree.
>

Correction: assuming b is a variable, not property.


More information about the Digitalmars-d mailing list