DConf 2015?

Adam D. Ruppe via Digitalmars-d digitalmars-d at puremagic.com
Wed Dec 24 08:27:02 PST 2014


On Wednesday, 24 December 2014 at 16:19:16 UTC, Kagamin wrote:
> Just make opDispatch accept zero or more arguments, when zero 
> arguments are passed, it works as a property, when more 
> arguments are passed, it works like a method call, no need for 
> @property.

That doesn't work with functions that take zero or one arguments:

obj.foo(); // still calls opDispatch, not the returned property

obj.foo(bar); // indistinguishable from obj.foo = bar


With the ref return getter, pretty much everything else works 
right, but these two cases are still ambiguous.


More information about the Digitalmars-d mailing list