DIP23 draft: Fixing properties redux

kenji hara k.hara.pg at gmail.com
Sun Feb 3 08:28:37 PST 2013


2013/2/4 Andrei Alexandrescu <SeeWebsiteForEmail at erdani.org>

> We need to add this to the proposal. There are two schools of thought here:
>
> 1. Make properties emulate regular variables as much as possible. In that
> case &a.p is the same as &(a.p), i.e. it applies to the returned value.
> (One counter-argument here is that properties should seldom return a
> reference because that breaks encapsulation.)
>
> 2. Allow people to do whatever they need to do without much aggravation.
> In that case &a.p obeys the normal rules of taking a method's address, and
> &(a.p) applies to the returned value.
>
> I favor (2) and put it in http://wiki.dlang.org/DIP23. Will talk to
> Walter.


I have thought about the problem, and filed an enhancement.
http://d.puremagic.com/issues/show_bug.cgi?id=9062

But, Walter disagreed against it.
http://d.puremagic.com/issues/show_bug.cgi?id=9062#c13

 Kenji Hara
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20130204/c99db6bd/attachment.html>


More information about the Digitalmars-d mailing list