Michel Fortin wrote: > On 2009-07-24 22:58:33 -0400, Andrei Alexandrescu > <[email protected]> said: > >> This is pretty clean, and in keep with the opXxx approach. Actually how >> about defining property foo by defining opGet_foo and opSet_foo. > > The problem with this is that it's ugly. What about this > > int foo.opGet(); // getter > void foo.opAssign(int); // setter > > with some support from the compiler. > > It could even be exteded to support more: > > int foo.opIndex(int); // foo[1]; > void foo.opAddAssign(int); / foo += 1; > void foo.invert(); // special function attached to property > >
There is a thread discussing the proposal which is also linked to by the wiki. Posting there would be useful, for future reference too.
