Possible @property compromise
TommiT
tommitissari at hotmail.com
Wed Jan 30 13:07:54 PST 2013
On Wednesday, 30 January 2013 at 20:28:32 UTC, Jacob Carlborg
wrote:
> Sure, but I think that's what properties are for. We currently
> don't have that in D but I think it would be great if fields
> could be exchanged with methods without breaking the API.
The problem is that genie is out of the bottle once you have
committed yourself to an interface where there is a public member
variable. And you can't put the genie back in the bottle any
more. This means that your interface can't add any encapsulation
over this public member variable afterwards without changing the
interface.
More information about the Digitalmars-d
mailing list