Object based octave instead of Object Oriented Octave...

John W. Eaton jwe at octave.org
Mon Apr 13 15:33:17 CDT 2009


On 11-Apr-2009, James Moliere wrote:

| I'm trying to learn Octave's new 'Object Oriented Programming'.  I must 
| say, I didn't see anywhere in the documentation the concepts of 
| inheritance so I recommend that the phrase 'Object Based Programming' be 
| used.  Please correct me if I'm wrong.
| 
| I also played with a counter class that simply increments when the inc() 
| method is called.
| 
| octave:1> a=counter(1)
| octave:2> b=counter(5)
| octave:3> c=counter(2, a)
| octave:4> c=inc(c)
| 
| with the error
| error: class has no member `other'
| error: evaluating argument list element number 1
| error: evaluating argument list element number 1
| error: called from:
| error:   /home/jmoliere/octave/@counter/inc.m at line 8, column 8
| error:   /home/jmoliere/octave/@counter/inc.m at line 8, column 8
| 
| How do I formerly create class members? ...I couldn't find the phrase 
| 'class member' in the Octave documentation version 3.1.52+.

3.1.52+ indicates that you are using a copy of Octave built from the
Octave development source archive, and that it is out of date.  We
recently made some changes to implement class inheritance that is
intended to be compatible with the way Matlab works.  I'm not sure it
is complete yet, but the recent changes are a move toward full
compatibility.  As a first step, I suggest updating your installation.

jwe


More information about the Help-octave mailing list