| Suppose that I read the .mat file without concerning myself about the
| parent structure. This involves simply creating an octave_class,
| setting the class name, and then creating a octave_map, I think
| (actually, I recall Cells being used, but I think we can still do this).
|
| Then I can walk through the elements in the map. IF the map elements
| are objects AND the object's class name is the same as the name of the
| struct field, just assume that I have a derived class. Add it to the
| parent list for the class. This has to recurse of course for multiple
| levels of inheritance.
Instead of faking it, let's keep track of the classes that we have
constructed, and then look at those for the parent and field info.
Then if there is a mismatch, we can report it. If an exemplar doesn't
exist, you can call the constructor to attempt to create one.
I've checked in a patch that implements the storing of exemplars, and
checks newly constructed objects against them, so if the constructor
changes and the object is different, we will now get an error (a
diagnostic that was previously missing in Octave). The patch for this
is here:
http://hg.savannah.gnu.org/hgweb/octave/rev/d8f9588c6ba1
I've also updated my previous patch to look for objects in the
exemplar map before attempting to call the constructor. My current
draft is attached below. I haven't checked it in since it is still
not complete, and I think it should use some more testing.
We also still need to implement things like "clear classes".
jwe