3 ms·
A common idiom in C APIs is to pass a struct pointer as the first argument to functions (as sort of a pseudo-thispointer). It would be nice to have this extens
by invokestatic 6y ago
A common idiom in C APIs is to pass a struct pointer as the first argument to functions (as sort of a pseudo-thispointer). It would be nice to have this extension at least simply for syntactic sugar for C interoperability.
- acqq 6y agoOn another side, one can argue that the implemented "unification" is anyway just for a convenience of using a dot call instead of just passing the reference to the object as the first parameter of a "plain" function call.
- secondcoming 6y agoThis is exactly what 'this' is in C++, it's a pointer to the class/struct instance and the compiler inserts it as the first parameter behind the scenes. There's no difference between a class method and a class static function that takes a pointer to a class insance as its first parameter.