opPropDispatch
Jonathan M Davis
jmdavisProg at gmx.com
Sun Apr 22 16:21:41 PDT 2012
On Monday, April 23, 2012 01:01:48 Adam D. Ruppe wrote:
> On Sunday, 22 April 2012 at 22:36:12 UTC, Jonathan M Davis wrote:
> > Eventually -property will be the normal behavior.
>
> Note that -property adds zero value, much like the current
> implementation of @property, which fails to disambiguate
> cases:
>
> ==
> import std.stdio;
>
> alias void delegate() callable;
>
> class Test {
> @property callable a() { return { writeln("hello"); }; }
> }
>
> void main() {
> auto t = new Test();
> t.a(); // does NOT say hello
> t.a()(); // this does
> }
> ==
>
> I thought this case was the WHOLE POINT of adding
> @property, and it is still wrong.
Then there's a bug that needs to be fixed.
http://d.puremagic.com/issues/show_bug.cgi?id=7970
> Note that this should work just fine without the
> pointless baggage that is -property, since the
> @property gives the necessary info to disambiguate
> it. But, apparently, the compiler ignores it all,
> with or without the switch.
Well, I completely disagree with you on @property. I think that definitely adds
value and that we're far better off having it - as long as it's properly
enforced. But we've debated this before, and from what I can tell, neither of
us is going to convince the other. @property has proven to be one of the more
devisive feature changes in D.
- Jonathan M Davis
More information about the Digitalmars-d-learn
mailing list