Fixing D's Properties

BCS ao at pathlink.com
Sat Aug 18 20:13:58 PDT 2007


Reply to Ender,

> int getX(){ return x;}
> void setX(int i){x = i;}
> property int X(&getX, &setX);
> 
> the problem is that unlike in python we cannot use keywords to set
> paramaters so some syntax would have to be made for write only
> properties, maybe if we used inout instead of property:
> 

property int X(void, &setX);
property int Y(&getY, void);

??

I'm not sure I like this more than what we have, but it does leave open getting 
at the functions which I like. It might grow on me.





More information about the Digitalmars-d mailing list