How do I get
string add_two(int x) { return ::add_two(x)+"two"; }
to work in Sub?
The easiest way is probably to use the getter/setter syntax instead:
class Base { mixed `add_one() { return lambda(int x) { return x+1; }; }
mixed `add_two() { return lambda(int x) { return x+2; }; } }
class Sub { inherit Base; string add_two(int x) { return ::add_two(x)+"two"; } }
The obvious alternative is something like:
string add_two(int x) { return ::`->("add_two")(x)+"two"; }