Taking address of properties

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri Feb 8 13:02:09 PST 2013


On 2/8/13 2:05 PM, Robert wrote:
> Look at the section "No module-level properties". Why not?! That's a
> perfectly valid use of properties. The proposal disallows module-level
> properties, but instead allows:
> 	42.fun = 43;
> which reads like: assign 43 to the fun property of 42. We get this
> really obscure feature but disallowing module-level properties? If that
> is not wrong, than I don't know what is.

There would be ambiguities with module level properties. A property with 
one argument may be either a setter for a module-level property or a 
getter for the property of a module-level object.

Andrei



More information about the Digitalmars-d mailing list