Possible @property compromise

Steven Schveighoffer schveiguy at yahoo.com
Thu Jan 31 20:41:41 PST 2013


On Thu, 31 Jan 2013 22:38:04 -0500, Andrei Alexandrescu  
<SeeWebsiteForEmail at erdani.org> wrote:

> On 1/31/13 10:14 PM, Jonathan M Davis wrote:
>> On Friday, February 01, 2013 01:01:02 Jesse Phillips wrote:
>>> I think his suggestions need implemented regardless of what we do
>>> with @property. I think Walter just felt this would appease the
>>> pro-property.
>>
>> Well, it doesn't even come close. For the most part, the pro- at property  
>> folks
>> want explicit proprties, and that's precisely what Walter is proposing  
>> that we
>> get rid of.
>>
>>> writeln = "hi" would not compile with Walters suggested changes.
>>
>> Only because it's variadic. Something like
>>
>> range.popFrontN = 7;
>>
>> _would_ compile. And that's just as bad. We need explicit setter  
>> properties in
>> order to avoid letting assignment work with functions where it makes no  
>> sense
>> for it to work.
>
> Under some proposals range.popFrontN = 7 would not compile because  
> there's no corresponding range.popFrontN that yields an int.

I don't think this rule is good enough.

You are inviting strange properties to invade your types, especially with  
the advent of UFCS.

-Steve


More information about the Digitalmars-d mailing list