octave-maintainers
[Top][All Lists]
Advanced

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

Re: Possible (summer of code) projects for Octave


From: John W. Eaton
Subject: Re: Possible (summer of code) projects for Octave
Date: Wed, 5 Jan 2011 20:33:56 -0500

On  5-Jan-2011, bpabbott wrote:

| One feature of the new OOP is that an object's methods can modify itself.

I think that is true only if it is a handle class object, not a value
class.

| Take a look at ML's inputParser.
| 
| http://www.mathworks.com/help/techdoc/ref/inputparser.html
| 
| The scheme for an inputparser object, "p", can be modified by its methods. For
| example ...
| 
| p.addRequired('filename', @ischar);

Try

  isa (p, 'handle')

If it returns true, then I think p is a handle class object.

| I don't think this can be accomplished using the @classname
| directory approach.

Looking here:

  http://www.mathworks.com/help/techdoc/matlab_oop/brqy4ox-1.html

it seems that the @classname directory structure is now just a way to
allow a class definition to be spread among multiple files.  So, we
have the following possibilities:

  1. @classname with old-style OOP constructor and method definitions,
     one method per file.

  2. @classname with new-style OOP constructor and method definitions,
     one method per file.

  3. classname.m with new-style OOP constructor and method definitions
     all in one file.

It appears that the way you can tell whether you have 1 or 2 is to
look at the classname.m file and see whether it begins with a classdef
block.  If @classname/classname.m has a classdef block, then it can
define a handle class (by deriving from the built-in(?) handle
superclass) or a value class.

On top of all that, you can have package directories that group class
definitions and ordinary functions together.

jwe


reply via email to

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