@property - take it behind the woodshed and shoot it?
deadalnix
deadalnix at gmail.com
Fri Jan 25 08:53:42 PST 2013
On Friday, 25 January 2013 at 16:47:56 UTC, mist wrote:
> On Friday, 25 January 2013 at 16:29:40 UTC, deadalnix wrote:
>> So you DO make a difference between setters and getters.
> Yes, sure. But I do not need new keywords for that.
>
Because you invalidate most legitimate use of a setter.
>> funName(t) is valid if funName returns a delegate. The
>> compiler shouldn't even try to interpret funName(...) as a
>> call of funName.
>
> Yes, I have finally understood how it is intended to work. I
> just do not like complexity with re-writing funName(t) as
> funName()(t) and hidden struct creation from function symbols.
> I cheer any compiling restrictions, but overall type system
> should be as transparent as possible for normal cases. Like
> brutal simplicity of my proposal better :)
>
A struct with a function pointer and data already exists in D.
This is called a delegate.
> But it is an interesting approach, thank you for the insight.
More information about the Digitalmars-d
mailing list