Please see the following Python code:
class Object: @classmethod def __repr__(cls): typeNames =  try: for t in cls.mro(): typeNames.append(t.typeName) except AttributeError: pass return " > ".join(reversed(typeNames)) class Vehicle(Object): typeName = "MyVehicle" class FourWheeler(Vehicle): typeName = "MyFourWheeler" class Car(FourWheeler): typeName = "MyCar" print(Car())
MyVehicle > MyFourWheeler > MyCar
I would like to know if something like this is possible in Haxe and if yes then how?
I am looking to represent some type heirarchies like this and find the
mro() facility of Python very useful for this, but want it to be portable in other languages via Haxe.