Considering what I think you ask the short answer is
no.
Assume this:
Code: Select all
interface window
...
end interface window
interface control supports window
...
end interface control
class textControl : control
...
end class textControl
We have a class
textControl which constructs objects of the interface type
control. The interface type
control supports the interface type
window, so all controls are also windows, but windows does not need to be controls.
control is the
construction type of the class
textControl (because
textControl constructs such objects).
window and
control are types, but
textControl is
not a type.
Consider this code:
Code: Select all
clauses
run() :-
TC = textControl::new(),
TCN = typeLibrary::typeLibraryOf(TC).name(),
stdio::writef("TCN = %\n", TCN),
useAsWindow(TC).
class predicates
useAsWindow: (window W).
clauses
useAsWindow(W) :-
WN = typeLibrary::typeLibraryOf(W).name(),
stdio::writef("WN = %\n", WN),
if C = tryConvert(control, W) then
CN = typeLibrary::typeLibraryOf(C).name(),
stdio::writef("CN = %\n", CN)
end if.
We create a
textControl it has type
control, so the type library of
TC will correspond to control and
TCN will get the value "control". When we call
useAsWindow we exploit that a
control is also a
window. The type library of
W will correspond to window and
WN will get the value
"window".
In the if-statement we try to convert the
window W to a
control, and in this case it will succeed because our object is (also) a
control. Subsequently
CN will become
"control".
What you get in all cases is the
view-type and what you ask for (as far as I understand) is the
construction-type (which is an interface not a class).
Clearly, the runtime system knows whether the
window is a
control or not, but that information is not exposed for reflection/introspection.