Re: Public variables inside interfaces

2011-04-30 Thread Olivier Pisano
Hi, You can disguise method calls into variables by using the @property tag. interface Sizeable { // Getter @property int size(); // Setter @property int size(int s); } class A : Sizeable { int m_size; public: this() { } @property int size() { return

Public variables inside interfaces

2011-04-30 Thread Mariusz Gliwiński
I like the possibility of abandoning () in function calls in D, so we can firstly make attribute public and then if implementation changes, smoothly change it into function: call: code auto a = new A(); writeln(Size is +a.size); auto b = new B(); writeln(Size is +b.size); class A {

Re: Public variables inside interfaces

2011-04-30 Thread Peter Alexander
On 30/04/11 1:22 PM, Mariusz Gliwiński wrote: I like the possibility of abandoning () in function calls in D, so we can firstly make attribute public and then if implementation changes, smoothly change it into function: snip Although, if I'd like to make interface Sizeable, it's impossible to