Open KAYLukas opened 10 years ago
Type checking of the class vtable will always ensure type correctness
In case statement expressions do not exist, we should require the given instance to be a lvalue:
n = n;
ensures the compiler requires this.
We need to implement methods on specific objects. These methods should overloadable, therefore a pretty simple VTable can be used at the end of the class struct. The macro mapping should be something along the way of:
Maps in:
It would be better to chain them with tertiary operators instead of this more readable version, as tertiary operators are standard C.
So basically next to the macro we also need to implement a Runtime scope handler. Each file should have its own scope variable 'this', the runtime should set the scope when needed, and the runtime should pop the scope back to its original state. When recursive functions are used, the runtime should just remember the amount of recursions instead of saving the same variable over and over.