On Mon, Jul 27, 2009 at 7:13 AM, Steven Schveighoffer<schvei...@yahoo.com> wrote: > On Fri, 24 Jul 2009 17:40:37 -0400, Walter Bright > <newshou...@digitalmars.com> wrote: > >> Ary Borenszweig wrote: >>> >>> Maybe what scares Walter is a whole new syntax for properties. >> >> It doesn't scare me. It's trivial to add more syntax. >> >> It's just that D is complex enough - there needs to be some very good >> reasons for adding more syntax that has apparently zero semantic information >> that would be different from the usual function syntax. > > OK, so you don't like the idea of adding dedicated properties. > > What is *your* solution to forbidding abuses like this: > > writefln = "hi"; > > ??? >
I think his suggestion was the Java-style approach -- special naming convention for get/set functions: int opGet_foo() { return foo_; } void opSet_foo(int foo) { foo_ = foo; } private: int foo_; --bb