Beta D 2.069.0-b1

Martin Nowak via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Fri Oct 9 19:31:50 PDT 2015


On Saturday, 10 October 2015 at 02:15:14 UTC, Adam D. Ruppe wrote:
> On Saturday, 10 October 2015 at 01:52:36 UTC, Martin Nowak 
> wrote:
>> What would you use that for, a handwritten interface struct 
>> with function pointers made read-only using @property?
>
> var a = var.emptyObject; // works today
> a.prop = { do_stuff; }; // works today
> a.prop(); // useless no op
> a.prop()(); // this is needed
>
> That one case alone is all I care about @property for.

That's what I meant, weird use-case, at best it's a callback 
better/setter.
I've never written such code, but even if you would, the 2 pairs 
of parens are only a tiny problem for generic code, nothing to 
warrant the invasive language feature @property is.


More information about the Digitalmars-d-announce mailing list