@property - take it behind the woodshed and shoot it?

mist none at none.none
Fri Jan 25 06:29:21 PST 2013


On Friday, 25 January 2013 at 14:18:43 UTC, TommiT wrote:
> I don't see 1.foo the way you see it. I see it like this:
>
> @property bool is_zero(X value)
> {
>     return value == 0;
> }
>
> void main()
> {
>     X value;
>     value.is_zero;
> }
>
> It's just that X happens to be a built-in type, instead of a 
> user-defined type. But I don't see why should that matter.

It is a tempting attempt to save two symbols of typing that 
completely breaks property semantics. I am objecting against it. 
With all my passion.
Use value.is_zero() for UFCS magic.


More information about the Digitalmars-d mailing list