help-octave
[Top][All Lists]
Advanced

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

Re: defining types in m-files?


From: Andy Adler
Subject: Re: defining types in m-files?
Date: Tue, 2 Sep 2003 16:44:00 -0400 (EDT)

On Fri, 29 Aug 2003 address@hidden wrote:
> On 27 Aug 2003 at 23:27, Andy Adler wrote:
> > On Wed, 27 Aug 2003 address@hidden wrote:
> > Do you have a link which explains the Matlab API approach to
> > new types?
> A google search for "matlab classes" should work.

I found some fairly good descriptions. I should have checked first.
Here is a fairly good one:
 www-h.eng.cam.ac.uk/help/tpl/programs/Matlab/oo.html


> > Do you have any oppinions about what it does
> > right/wrong?
>
> Some issues are a little strange, such as the need to define
> all methods of class t in a subdirectory called @t somewhere
> on your path.
>
> Dispatch rules for overloaded functions are complicated.
> You need to create a precedence heirarchy so that calling
> for example a function like fn(poly,sparse) knows whether
> to call the @poly/fn or @sparse/fn (assuming that
> both of these exist).

The Matlab class system seems to be modelled closely on
Perl, but it appears to me even more of a "hack".

I'm not sure how popular the Matlab class system is, so its
not clear whether it would be worth the pain to copy.
I don't know anyone personally who uses it. I think the
decision to not use obj.method or obj->method syntax
makes it much less obvious to use than it could be.

It would seems that 'dispatch' allows most of the features
to be implemented. (I'm assuming here that an OO
system without inheritance is basically a type
extension system. Of course, I may be wrong)

Thanks

andy



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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