Hooks for translating custom datatypes
Recent versions of MATLAB use objects/classes more and more frequently. Unlike structs, objects cannot be accessed with the C APIs.
It would be nice if a future version of MATLink added extension hooks so that the translation of custom datatypes can be implemented by other packages.
It is not clear how deeply this can be integrated. Can MGet be made extensible without compromising performance? This should be investigated.
One difficulty here is handling special datatypes when they are part of another structure (e.g. struct or cell). Both struct s and cells are retrieved and translated in C code. What can we do if midway throughout the translation this C code encounters a datatype that can't be handled with the C API?
One possible solution (to be investigated) is to simply create new temporary variables in the MATLAB workspace to hold these pieces of data, using mexPutVariable, then register them for later translation.
It should be investigated if mexPutVariable creates a full copy or employs copy-on-write.