property syntax strawman
Chad J
chadjoan at __spam.is.bad__gmail.com
Sun Aug 2 07:35:58 PDT 2009
Chad J wrote:
>
> If you were willing to implement attribute syntax, then you could
> probably please almost everyone (I hope). The omissible parentheses
> could be left in. It would be possible to create these entities that
> are both functions and properties at the same time. They wouldn't be
> hazardous anymore. @property could be used to mark a strict property
> declaration. Such a declaration would forbid being called with
> parentheses, and thus allow better enforcement of API conventions,
> better analysis by 3rd party tools and generative code, and allow
> delegates to be returned from properties. Fields could be migrated to
> properties or strict @properties with very little API breakage, while
> only strict @properties could be migrated to fields with (maybe) zero
> API breakage.
I should clarify that this paragraph assumes the aforementioned
expression rewriting were implemented.
More information about the Digitalmars-d
mailing list