@property needed or not needed?

Adam D. Ruppe destructionator at gmail.com
Tue Nov 20 11:12:56 PST 2012


On Tuesday, 20 November 2012 at 19:06:22 UTC, Jonathan M Davis 
wrote:
> Given the fact that this subject is extremely devisive, I 
> suspect that the
> best that we can hope for at this point is for lax property 
> enforcement

@property shouldn't be about enforcement. This is the fundamental 
flaw in the -property switch. While I think you and I are talking 
about the same goal, this is an important distinction to make: 
the fix isn't syntax. It is a semantic rewrite.

After referencing a property is rewritten to be a call, the 
syntax will just work:

@property int foo() {}

int a = foo(); // the error here is NOT "you must not use () on 
properties". It is "type int is not callable"



This is something that's bothered me about the @property debate 
since day one: we spend all this time talking about syntax.... 
but that's a side effect, not the core question.


More information about the Digitalmars-d mailing list