On Thursday, 31 May 2018 at 01:49:42 UTC, DigitalDesigns wrote:
https://dpaste.dzfl.pl/6c6e614b58ac
The problem given in the list, is that a ref getter is used
when a setter does not exist. Why have a setter then?
One problem is that if the setter has different behavior than
the getter
On Thursday, 31 May 2018 at 01:49:42 UTC, DigitalDesigns wrote:
Using setters, we might want to trigger an event when the value
changes. But since the getter is used and can modify the event
won't be triggered.
This is a bad design.
Here's similar bad design:
---
class Int
{
public int
On Thursday, 31 May 2018 at 01:49:42 UTC, DigitalDesigns wrote:
https://dpaste.dzfl.pl/6c6e614b58ac
The problem given in the list, is that a ref getter is used
when a setter does not exist. Why have a setter then?
[...]
Please report issues at https://issues.dlang.org otherwise it
will be
https://dpaste.dzfl.pl/6c6e614b58ac
The problem given in the list, is that a ref getter is used when
a setter does not exist. Why have a setter then?
One problem is that if the setter has different behavior than the
getter there will be problems.
The other problem is that += modifies the