From octave-maintainers-request at bevo dot che dot wisc dot edu Sun Nov 16 07:53:29 2003 Subject: Re: Documentation for dynamically loadable types? From: pkienzle at users dot sourceforge dot net To: N Smethurst , octave-maintainers mailing list Date: Sun, 16 Nov 2003 08:56:30 -0000 On 13 Nov 2003 at 12:29, N Smethurst wrote: > Hi all > > This is related to a message I posted to the octave-graphics list: > > Is there any documentation explaining how to create dynamically loadable types > in Octave? I didn't find much info on this subject, but I haven't looked for > some months. I wonder if we should make a handle base class which can be shared by things like files and graphical objects. The base class should support array operations and direct access to handle fields via the structure dereference operator "." Set/get functions can be implemented using h.('prop') form of dereference. So long as concatenation [g,h] and indexing h(i) are supported, this should be compatible with matlab's opaque handles (for the current release anyhow ;-) while being more convenient to use. The next step would be to allow user defined handles with properties controlled from m-files rather than oct-files. As for help defining new types, the octave examples directory includes an example of defining a new integer and octave-forge includes definitions for five new types. The simplist is a triangular matrix type defined in extra/linear-algebra/ov-re-tri.h. The others are in main/comm, main/symbolic, main/sparse, and main/miscellaneous/dispatch.cc. Plus you can see how types are defined in the octave code, which you will need to understand structure dereferencing anyway. Paul Kienzle pkienzle at users dot sf dot net