Agehall wanted to overload access to a certain identifier in an object, whereas the old discussion was about returning another value when the the value of the object itself is requested. The latter could probably be used to implement the former as your example shows, but it isn't necessary to do it that way. A solution restricted to a named lvalue would work too.
/ Martin Stjernholm, Roxen IS
Previous text:
2003-12-21 17:55: Subject: Re: C#-like properties
No it isn't. The "set" function in the Foo object is exactly the `= operator, and the "get" function is the corresponding read operator (I don't remember if we gave it a name, possibly the cast lfun was used somehow). This is Agehall's C# code in Pike syntax, using the imaginary `= operator, and an equally imaginary `get operator.
static int foo; object Foo = class { int `get() { return foo; } void `=(mixed value) { foo = value; } }();
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)