Stephen R. van den Berg wrote:
If I want this to print 12 (instead of 4), how do I need to tell Pike to access the c-member from b->set() in class a instead of the one in class b?
Hmmm, I vaguely remembered this topic has already been mentioned on the mailinglist... I found this gem after some poking (it's still not in the official docs, or is it?):
Grubba wrote: Forcing resolution in the current object (rather than in the set of local variables) without resorting to renaming of symbols can be done with the ::-operator:
o this_program::x The symbol x in the current class. o local::x The symbol x in the current class accessed as if the symbol was declared local (ie bypassing overloading). o ::x The inherited symbol x in the current class. o global::x The symbol x in the (implicit) outermost class of the compilation unit. o A::x The inherited symbol x from the inherit A in the current class. Or the symbol x in the lexically nested (including the current) class with the name A. o A::B::x Same lookup for A as above, but then the symbol x in the inherit B in A. o global::B::x The symbol x from the inherit B in the outermost class.
For completeness I'll list the following two syntaxes as well:
o predef::x The symbol x from the set of all_constants(). o 7.4::x The 7.4 compatibility implementation of the symbol x (this syntax was added in Pike 7.8).