Regarding terminology: I prefer talking about "inheriting" and "inherited" classes in the case of programs. Both programs and objects can have a "parent" program/object which is that of the lexically surrounding class as your example shows. For consistency, the "child" of a program/object ought to be the reverse of the "parent".
Note that as an optimization in 7.4, objects that do not access anything in their surrounding objects won't get a parent pointer unless one uses the save_parent pragma. Programs will however always have a parent pointer when they aren't on the top level in a compilation unit.
The parent of an object (providing the parent pointer hasn't been optimized away) can be retrieved with function_object(object_program(o)).
The parent of a program is retrieved with function_program(p).
The inherited programs of a program is listed with Program.all_inherits(p).
/ Martin Stjernholm, Roxen IS
Previous text:
2003-03-04 08:50: Subject: Children and Clones
The point of that paragraph was basically stating that I could only find builtin functions for determining parents of programs and not objects.
Object parents is a totally different thing. There used to be a parent_of (or similar) function, but I think it was removed for some reason. Object parenting/childs occur when you do things like this:
class Parent { int x; class Child { ...x... }
Child child() { return Child(); }
}
which is orthogonal from inheritance. Note the use of 'x'. (Without that, you might not get a parent/child relation.)
So I can find all the children of a specified object!! *grin*
That is rather easy in most projects I've been involved with, the number of objects has been rather limited, or already placed in easy-to-reach lists...
Again, why do you want to find all usage of a specific program (which I still assume is what you ask for)? The only place I can see where that might be useful is in mud environments...
/ Mirar