Introduction to OOP | Chapter 25: Reflection and Introspection : | next | previous | audio | real | text |
if Member(aVariable, Child) then aChild = Child(aVariable) (* Object Pascal *)This is needed for downcasting.
However, if you find yourself using this a lot, then you aren't thinking in an object-oriented way, since often such situations can be better written using polymorphism.