Reddit: why aren't people using D?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Jul 27 10:59:53 PDT 2009


Bill Baxter wrote:
> On Mon, Jul 27, 2009 at 7:13 AM, Steven
> Schveighoffer<schveiguy at yahoo.com> wrote:
>> On Fri, 24 Jul 2009 17:40:37 -0400, Walter Bright
>> <newshound1 at digitalmars.com> wrote:
>>
>>> Ary Borenszweig wrote:
>>>> Maybe what scares Walter is a whole new syntax for properties.
>>> It doesn't scare me. It's trivial to add more syntax.
>>>
>>> It's just that D is complex enough - there needs to be some very good
>>> reasons for adding more syntax that has apparently zero semantic information
>>> that would be different from the usual function syntax.
>> OK, so you don't like the idea of adding dedicated properties.
>>
>> What is *your* solution to forbidding abuses like this:
>>
>> writefln = "hi";
>>
>> ???
>>
> 
> I think his suggestion was the Java-style approach -- special naming
> convention for get/set functions:
> 
> int opGet_foo() { return foo_; }
> void opSet_foo(int foo) { foo_ = foo; }
> private:
> int foo_;
> 
> --bb

For one thing I like that I now get to define empty() for a range and 
then call it with r.empty. I'd think it would be a small step backward 
if I had to define get_empty() or something instead.

Andrei



More information about the Digitalmars-d mailing list