help-octave
[Top][All Lists]
Advanced

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

Re: Octave classes


From: Massimo Manghi
Subject: Re: Octave classes
Date: Wed, 03 Oct 2012 10:10:09 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.7) Gecko/20120922 Icedove/10.0.7

On 10/02/2012 02:28 PM, Jordi GutiƩrrez Hermoso wrote:
On 2 October 2012 08:20, Juan Pablo Carbajal<address@hidden>  wrote:

afaik, there is no inheritance in Octave classes.

Of course there is. Otherwise, what's the point of having classes at all?

     
http://www.gnu.org/software/octave/doc/interpreter/Inheritance-and-Aggregation.html
     http://www.gnu.org/software/octave/doc/interpreter/Overloading-Objects.html


Thanks Jordi and Juan

so the bottom line is that for the time being I have to prepare myself my own base class. Good to know.

Scripting an object systems almost certainly requires some degree of introspection (the larger the better).

So I go back to the original question. I noticed a discrepancy between the functions 'fieldnames' and 'isfield': 'fieldnames(...)' returns an array of fields of a structure or a class, 'isfield(struct,field_name)' doesn't know how to handle a class object and returns invariably 0, even though it could be based on the former simply comparing each field in the list returned by 'fieldnames' to the given field_name. This looks to me like a bug or a missing feature...

> Octave currently only implements old-style Matlab classes. There's
> some preliminary work for classdef, but it will probably take some
> time to come to fruition, unless you help.
>
> - Jordi G. H.

I have a decent experience programming C++ and I wrote a couple of C++ command extensions to Octave, but I never tweaked the core. So the answer is yes, I could consider to help if you get me on the right track (subscribing octave-dev? Contacting the person who is carrying on the development of the object system?)

 -- Massimo


reply via email to

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