@property - take it behind the woodshed and shoot it?

Iain Buclaw ibuclaw at ubuntu.com
Sat Aug 10 08:41:14 PDT 2013


On 10 August 2013 13:27, JS <js.mdnq at gmail.com> wrote:
> On Thursday, 24 January 2013 at 08:35:01 UTC, Walter Bright wrote:
>>
>> This has turned into a monster. We've taken 2 or 3 wrong turns somewhere.
>>
>> Perhaps we should revert to a simple set of rules.
>>
>
>
> Here is my mindless proposal after reading some of the posts.
>
>
> 1. Properties are data. Cannot be called with parenthesis, unless it returns
> a delegate, in which case the delegate is called. The address of a property
> is invalid(possibly gotten through a trait).
>
> 2. Properties cannot be used in UFCS calls, unless they return a delegate.
> Only UFCS chaining allows for parenthesis-less calls. e.g., (). -> .
>
> Properties are great, C# doesn't have any issues with them... so why should
> D? From the little reading, the best I can tell is that the issue comes
> directly from UFCS and trying to avoid using parenthesis.
>

Might be wrong "cause I've only spent 5 minutes looking at it severall
months ago" but C#'s properties are just simple getter/setter's, no?

-- 
Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';


More information about the Digitalmars-d mailing list