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: Wed, 22 Apr 2009 18:41:31 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.21) Gecko/20090402 SeaMonkey/1.1.16

I hadn't thought of that. Good question and the answer is that there is no guarantee. In fact, some of my "real" classes require arguments. I think I have to go back to the drawing board on this.
Bob



John W. Eaton wrote:
On 22-Apr-2009, Robert T. Short wrote:

| Second way.  This is probably the more sensible way, and is almost
| certainly the way MATLAB does it.
| | When I read an object out of the .mat file, I need to force the
| constructor m-file for that object to be parsed and executed so that I
| have the struct built and ready, although what I really get is the
| parent list.  I then replace the individual elements that I read out of
| the file into the object's struct.  There has to be some checking to
| make sure that the struct is valid, etc., but that, I think, is pretty
| straightforward.
| | I think this works, yes? I have no idea how to cause the constructor to
| be parsed and executed, but I am sure I can figure this out.

Are constructors required to be callable with no arguments?  If not,
then how can you know what arguments to pass so that the call to the
constructor is valid?

jwe





reply via email to

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