octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OOP and load/save


From: John W. Eaton
Subject: Re: OOP and load/save
Date: Fri, 24 Apr 2009 14:27:08 -0400

On 24-Apr-2009, Robert T. Short wrote:

| Also, the notion of returning a struct if the class is
| not reconstructable seems easier, since you just take the map and
| return the base class rather than the derived class.

Please look at a function like octave_class::load_ascii.  It returns a
status code, not a class object, so "fixing" this problem is not that
simple a change to make.  Again, by the time there is enough
information to determine that a conversion should happen, it is too
late to simply return a differnt kind of object.  At that point, the
object has already been constructed.

This is not a problem for the MAT file reader, but then the MAT file
format can't be extended to handle new user-defined types that are
implemented in C++ (like the fixed class from Octave Forge, for
example).

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]