properties

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue Jul 28 11:19:49 PDT 2009


Bill Baxter wrote:
> On Tue, Jul 28, 2009 at 10:20 AM, Steven
> Schveighoffer<schveiguy at yahoo.com> wrote:
>> On Tue, 28 Jul 2009 12:30:00 -0400, Andrei Alexandrescu
>> <SeeWebsiteForEmail at erdani.org> wrote:
>>
>>> Steven Schveighoffer wrote:
> 
>> What if the compiler allowed you to call functions as long as what you
>> typed was an unambiguous prefix of the function name
>> why don't we have a
>> wonderful time-saving feature like this?  Because it would be a nightmare to
>> read.
> ...
>>> So now C# has two ways of providing a readonly field. Doesn't quite look
>>> like an example to follow.
>> Just like D!
>>
>> Yes, that's right.  readonly is analogous to const.
> ...
>>> That's what I'm saying: if it could do anything, at least don't pretend
>>> it's anything special. It's a function!
>> ...
>>   So would you argue that C# or D with operator overloading isn't
>> better because operators are just functions, why call them something else?
> 
> 
> Bravo!  Fine, rational arguments, Steve.

I don't think it's a good argument. Operators are functions with a 
specific syntax, is all. D is not even pretending any different: it 
simply rewrites the usual syntax into function calls. We should do the 
same with properties.


Andrei



More information about the Digitalmars-d mailing list