Do we want functions to act as properties, or merely omit parens for ufcs/chaining?

sclytrack sclytrack at dynamic.com
Tue Jan 29 03:03:07 PST 2013


On Tuesday, 29 January 2013 at 10:34:59 UTC, Sönke Ludwig wrote:
> Am 29.01.2013 05:16, schrieb sclytrack:
>> On Tuesday, 29 January 2013 at 01:09:17 UTC, F i L wrote:
>>> why in the hell would you want:
>>>
>>>     writeln = "lolwut";
>>>
>>> to compile in the first place?
>> 
>> If you disallow this. You will have to invent something else 
>> than opDispatch.
>> Something that serves them both. opPropMethodDispatch maybe.
>
>
> template opDispatch(string name)
> {
> 	static if( isAProperty!name ){
> 		@property int opDispatch() { return 0; }
> 	} else {
> 		void opDispatch() {}
> 	}
> }
>
> or similar should work.

I meant for dynamic D where you don't know if it is a property or 
a method at compile time. Where you don't know if the method even 
exists or not.

Overloading on an annotation is just weird. Either something is 
annotated or not.

Going to eat now.




More information about the Digitalmars-d mailing list