@property needed or not needed?

Mehrdad wfunction at hotmail.com
Mon Nov 19 14:19:53 PST 2012


On Monday, 19 November 2012 at 20:00:27 UTC, monarch_dodra wrote:
> You could argue that since a property-function is meant to 
> emulate an attribute, that calling one and doing nothing is 
> *always* wrong, regardless of side effect.


That's EXACTLY what I'm saying.

     foo.property;

is ALWAYS wrong semantically speaking, regardless of what it 
_could_ or _happens_ to do if it was/is defined.
So even if popFront() was a property, my point would be that it 
should not be a property in the first place.



It's like saying you should be able to add integers and function 
pointers just because they're both integers underneath.

Sure, the machine can do it, but we disallow it because it makes 
no sense.

Ditto here.


More information about the Digitalmars-d mailing list