Peter N Lewis wrote:
Does GPC support telling whether an object is a member of a particular object class hierarchy?
Mac Pascals have
member( obj, ObjectType )
obj is ObjectType
which returns a boolean, true if obj is an object of type ObjectType.
I've included a sample program below.
If GPC has an alternative way of telling this, that will probably solve my problem, although this may still be an issue for compatibility.
Maybe a macro could help ...
if member( base, ObjectBase )
This is always true due to the declaration, so GPC warns.
and member( a, ObjectBase )
GPC does not accept this one. This is "more than true", as by declaration, a is always of a subtype of ObjectBase already. So it's probably not a practically interesting case.
member( b, ObjectA )
This can never be true (by declaration). Again, probably not relevant in practice.
Frank