Property discussion wrap-up

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Jan 28 09:03:58 PST 2013


On 1/28/13 11:58 AM, Steven Schveighoffer wrote:
> On Mon, 28 Jan 2013 08:20:23 -0500, Andrei Alexandrescu
> <SeeWebsiteForEmail at erdani.org> wrote:
>
>> One interesting fact is that we have evidence at hand. Optional parens
>> _exist_ today in D, and have for a while. The language has worked.
>> They haven't been a disaster.
>
> I've seen some issues, but mostly for allowing normal functions as setters.

Agreed (I consider that feature distinct from optional parens).

> I would be perfectly fine ONLY defining @property on setters, and
> getters where the parentheses are confusing (i.e. getting a
> delegate/function pointer/functor).
>
> I would be fine with D CANCELLING @property as long as we had something
> like Objective C, where the function form of a setter CANNOT be mistaken
> for a normal function. In this case, we would have to live with delegate
> properties requiring two sets of parentheses.
>
> But if you get rid of @property and we are back to D1-style properties,
> please acknowledge that the abuse of functions as setters is not a good
> situation.

Agreed.


Andrei


More information about the Digitalmars-d mailing list