| TypeOf::class[symbol] checks, if symbol is class or a class derived directly or indirectly from class. While TypeOf tests classes, InstanceOf tests objects. |
This loads the package.
The next cell generates a tiny class hierarchy.
We now test for types. grandchild and greatgrandchild have child as (indirect) parent and are therefore also of type child. Analogously, greatgrandchild is also a grandchild. Objects are not recognized by TypeOf.
Any other "class" yields False.
Please observe that the ::-operator acts on the scond argument rather quickly. Therefore, the following fails.
|