octave-maintainers
[Top][All Lists]
Advanced

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

Re: OOP and load/save


From: Robert T. Short
Subject: Re: OOP and load/save
Date: Thu, 23 Apr 2009 10:44:06 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.21) Gecko/20090402 SeaMonkey/1.1.16

Judd Storrs wrote:
On Thu, Apr 23, 2009 at 1:02 PM, John W. Eaton <address@hidden> wrote:
Doing that requires special knowledge about the way an octave_class
object is defined and breaks the model of having the object load
itself.  At the point where enough information has been read from the
file to know that there is a problem, an octave_class object has
already been constructed, not an octave_map (struct) object.  Yes, we
could have a special case for class objects, but I don't think that's
a good solution.  We can probably do better than that, but as I said,
I think it will require some fairly substantial changes.  Doing it
cleanly and consistently for all objects may require breaking backward
compatibility for objects defined in C++ classes.  Not all of these
are part of Octave itself (for example, the fixed class in Octave
Forge).

jwe

I see. A while ago, I had just learned to accept that Matlab objects are basically just dumb structs that are treated differently, so that's how I have always approached them. But I guess that is "legacy" now, I had no idea there was a whole new OOP mechanizm in R2008a. So I'll have to play around with and get a feel for octave's smart objects and the new-fangled fancy Matlab objects. ;)

--judd
Judd, John,

Thanks for taking the time to look at this.  Having other views has been extremely valuable.

Dumb structs is a little unfair.  Now mind you, not all that far off, but a bit harsh.  There are lots of limitations, but I have done some very nice things.  The biggest problem is having lots of little m-files around that are all three-liners, but every change to the basic structure requires modifying a bunch of little files.


I would have used the newer flavor of OOP (classdef, etc.) except my MATLAB predates all of that and I have to deliver working MATLAB.  As soon as I can get all this legacy stuff out of the way - i.e. as soon as all of my code runs in octave - then I intend to add the newer features as well.

As you play around, it would be very helpful to have someone to make sure that test cases work in a newer MATLAB.  Perhaps you can help me out there?  Now, it may be that someone else ends up doing all of this, but having decent test cases will help no matter what.

Bob

reply via email to

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