help-octave
[Top][All Lists]
Advanced

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

Re: Octave classes


From: Juan Pablo Carbajal
Subject: Re: Octave classes
Date: Tue, 2 Oct 2012 14:20:23 +0200

On Tue, Oct 2, 2012 at 11:39 AM, Massimo Manghi <address@hidden> wrote:
> Hi guys
>
> I wrote a message to this list days ago which admittedly wasn't very well
> concocted and it went unanswered. I try with a more direct and explicit
> question.
>
> Is there somewhere some sort of implementation of a foundation class library
> for Octave? I'm trying to convert my scripts to classes but it seems methods
> like get, set, display need to be reimplemented every time, even though they
> do the same function for most of my classes. In other words: is there some
> class from which one could derive its own classes having those basic methods
> already available with a default functionality?
>
>  thanks
>
>  -- Massimo
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://mailman.cae.wisc.edu/listinfo/help-octave

afaik, there is no inheritance in Octave classes. Only composition
(you can do a hack by having a dummy class with the basic methods and
all new classes call those by default... horrible if you ask me).

You can have a few .m that you copy to all your new classes if they
all do exactly the same.

I think, jwe will release classdef for octave in the near future. then
you will have all the object thingy stuff.


-- 
M. Sc. Juan Pablo Carbajal
-----
PhD Student
University of Zürich
http://ailab.ifi.uzh.ch/carbajal/


reply via email to

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