KAYLukas / FoxyC

Adds class-oriented syntaxis to C, by using macro's only.
0 stars 0 forks source link

Implement the implementation and class further #5

Open KAYLukas opened 10 years ago

KAYLukas commented 10 years ago

The implementation and class keyword need to be updated to support VTables for function calls.

KAYLukas commented 10 years ago

We can ensure that the object n has an interface INode by defining a union in the structdef as follows: union{ Class* class; Class* __IMPLEMENTS_INTERFACE_INode; } This ensures in compile time that via can only be used on objects which implements the interface. Otherwise you should cast this.

unions can included recursively, if necessary to implement this