| InstanceOf::class[object] checks, if object was generated by means of class or a class derived directly or indirectly from class. The object must have been generated by New. |
This loads the package.
The next cell generates a tiny class hierarchy. The class child demonstrates a typical usage of InstanceOf.
As expected, obj and parent are accepted by f, because they do have base in their class hierarchy, while alien does not match.
The check can also be applied directly.
Any other "class" yields False.
Please observe that the ::-operator acts on the scond argument rather quickly. Therefore, the following fails.
|