new DIP5: Properties 2

Bill Baxter wbaxter at gmail.com
Mon Jul 27 19:07:40 PDT 2009


On Mon, Jul 27, 2009 at 6:33 PM, Benji Smith<dlanguage at benjismith.net> wrote:
>> On Mon, Jul 27, 2009 at 4:34 PM, Chad
>>>
>>> This seems to me like it adds more syntactic clutter than adding a
>>> keyword would:
>>>
>>> PropertyDecl:
>>>       PropertyGetter
>>>       PropertySetter
>>>
>>> PropertyGetter:
>>>       Type 'opGet_' Identifier '(' ')'
>>>
>>> PropertySetter:
>>>       Type 'opSet_' Identifier '(' Type ')'
>>>
>>>
> 2) A property is not an operator. So the "op" prefix is lying to you.

Well, you could think of it as "operation" instead of "operator" in this case.
But anyway I agree.  Getters and setters are ubiquitous.  I don't want
to have to see half a dozen instances of that eyesore in every class I
write.

The property keyword looks nice though.  What prevents us from doing
more generic annotations with syntax like @property?

--bb



More information about the Digitalmars-d mailing list