Make dur a property?

Timon Gehr timon.gehr at gmx.ch
Wed Jan 23 14:07:30 PST 2013


On 01/23/2013 10:59 PM, monarch_dodra wrote:
> ...
> --------
> IMO: We should be able to keep the optional parenthesis for all
> functions (except maybe those that return delegates). Things that are
> marked as property, however, MUST respect two things:
> 1) properties should *NEVER* have parentheses.
> 2) you should not be able to take the address of a property function.
> 3) The "a.prop = value" should call "a.prop(value)" IFF prop is declared
> property.
>
> This (I think), should make everyone happy. Callers can still choose
> their own styles, especially in the context of UFCS.
>
> As for @property: this makes it able to guarantee what it was originally
> designed for.
>
> ...
>
> Or am I completely wrong? Did I miss anything?

1 and 2 are necessary. I do not care about 3.

IIRC Adam likes to have both fun = value and fun(value) available for 
the same function.


More information about the Digitalmars-d mailing list