Possible @property compromise

Steven Schveighoffer schveiguy at yahoo.com
Thu Jan 31 07:09:36 PST 2013


On Thu, 31 Jan 2013 09:57:12 -0500, q66 <quaker66 at gmail.com> wrote:

> On Thursday, 31 January 2013 at 14:28:39 UTC, Steven Schveighoffer wrote:
>> As another option, what about changing my proposal so instead of setX,  
>> it's set_x, and then casing concerns are eliminated?  I think C++.net  
>> does that.
>>
>> -Steve
>
> No, that is not a solution either. Any of these setBlah or set_blah or  
> whatever are ugly hacks.

I don't agree, the benefit of being able to refer to the property as a  
function and as a property separately is nice.  For instance, you can get  
a delegate for the property.

The other benefit is that the setBlah or set_blah functions are  
self-descriptive as properties.  You would be hard pressed to argue such a  
function doesn't set a value called blah.

> There should be explicit property syntax. By explicit, I mean explicit -  
> at least like C#'s get/set stuff

I would be fine with that too, but with all due respect, the only person  
whose opinion matters is Walter.

If he is possibly interested in any of these proposals instead of  
@property, I think that's the one we should go for.

> (and I don't really like C# either).

Why don't we start with a language you DO like that has properties?  Or  
are you sour on all of them?

-Steve


More information about the Digitalmars-d mailing list