properties

Steven Schveighoffer schveiguy at yahoo.com
Tue Jul 28 13:35:45 PDT 2009


On Tue, 28 Jul 2009 16:21:09 -0400, Andrei Alexandrescu  
<SeeWebsiteForEmail at erdani.org> wrote:

> Steven Schveighoffer wrote:
>> On Tue, 28 Jul 2009 16:08:58 -0400, Andrei Alexandrescu  
>> <SeeWebsiteForEmail at erdani.org> wrote:
>>
>>> Steven Schveighoffer wrote:
>>>> However, when I see:
>>>>  x.empty;
>>>>  I can't tell what is implied here.
>>>
>>> You can. In either C# or D language it could execute arbitrary code  
>>> that you better know what it's supposed to do. D simply doesn't make  
>>> it "bad style" as C# stupidly does.
>>  still not getting it, are you...
>>  Just forget it, I think this is a lost cause, I keep making the same  
>> points over and over again, and you keep not reading them.
>
> I do read them and understand them. I mean, it's not rocket surgery. At  
> the end of the day you say "x = a.b;" looks more like sheer access  
> because that's what happens for fields already.

No, b has no meaning.  It's not an English word.

a.filter() looks like it should filter something.
a.filter looks like it should access a filter.

But in D, a.filter could mean either, which I guess is fine if you want to  
play it that way, but it's far inferior to C#, where a.filter should  
return a filter, and a.filter() should perform a filtering action.  If it  
doesn't, the author wrote his code incorrectly.  It's as simple as that.

> Then you say "a.b()" in any context looks more like an action because  
> it's clear that there's a function call involved.

Again, b means nothing, so I would have no idea in C# or D.

-Steve



More information about the Digitalmars-d mailing list