Taking address of properties
Steven Schveighoffer
schveiguy at yahoo.com
Fri Feb 8 09:52:27 PST 2013
On Fri, 08 Feb 2013 10:28:14 -0500, eskimo <jfanatiker at gmx.at> wrote:
> Ok, forget backwards compatibility for a moment, it was just an
> additional goody.
> On Thu, 2013-02-07 at 19:38 -0500, Steven Schveighoffer wrote:
>> Not with @property
>>
>>
>
> That's the point, it would no longer be a property but a simple function
> returning ref.
Then it doesn't conform to the range API, where front is a property.
> front for arrays would not be a property for two reasons:
> 1. front is a UFCS function, I think supporting UFCS with properties is
> just getting it wrong, have a look at DIP 23 if you don't believe me.
I don't believe you. DIP23 has flaws. Care to explain? "just wrong"
isn't an explanation.
> 2. My current version, would not allow properties to return ref, but
> instead a property is a property if it defines a getter or a setter or
> both with the following exact definition:
>
> @property void a(T val);
> @property T a();
This is a severe reduction in expression, we should not be looking for
extra ways to invalidate existing code unless there is an extremely good
reason. "Just wrong" is not it.
-Steve
More information about the Digitalmars-d
mailing list