octave-maintainers
[Top][All Lists]
Advanced

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

Re: How to implement IPT strel.m ?


From: David Bateman
Subject: Re: How to implement IPT strel.m ?
Date: Wed, 4 Aug 2004 09:40:26 +0200
User-agent: Mutt/1.4.1i

According to John W. Eaton <address@hidden> (on 08/03/04):
> 
> The @class directory hack is similar to the private function
> subdirectory hack.  It will require some changes to the file lookup
> code (in liboctave/pathsearch.cc).  Some time ago, I pared down the
> kpathsearch code and converted it C++ (use C++ strings, new/delete,
> etc.) in anticipation of having to modify it to handle these new
> features that are specific to Octave.  Also, I never liked the fact
> that there was no clean separation between the basic file lookup code
> and the TeX-specific features of the kpathsearch code.  Now the code
> for file lookup that is actually used in Octave is much smaller than
> before.  It is only about 3200 lines long in the file kpse.cc and the
> file in CVS has about 600 lines that are not currently used, so it
> could be even smaller.  We should be able to adapt this code and the
> symbol lookup code in Octave's symbol table to do the right thing when
> looking for functions once we define the proper search order.

Exactly. Any ideas what the right search order is. Do private functions
take precedence? What about those in a class? And what about structures
like @class1/@class2 that Matlab permits? Do they make any sense without
Simulink? Should we support them?

> I think the other tricks in supporting classes will be integrating the
> dispatch code with the core of Octave and supporing the strange class
> relationship hierarchy that Matlab has with "inferiorto" and
> "superiorto" (this will affect the way function searches are performed
> given the type of the first argument).

The stuff like superiorto, subsref, etc could be done with the
octave_value class that handles the function overloading. Stuff like
subsref is easy as the subsref of the overloading class
(octave_overload) would be called and it would hand it off to the
class specific m-file; if it doesn't exist -> error message.
superiorto, etc might be handled in two different ways. Either all of
the functions expected to be used might be overloaded in 
octave_overload, and then if the function to perform this doesn't exist
the function itself reports the error. Otherwise at the time of the
registration of the class we could search the class specific code for
the functions to overlaod and only overload those functions.

The second way is perhaps cleaner, but has the disadvantage that new
dot-m files in the class forthe binops and unary ops won't be seen
till after a restart of octave. This might be a bit counter intutitive
to some users. The first way, avoids this but instead has the problem 
of how to treat operations with mixed classes of arguments.

Cheers
David

-- 
David Bateman                                address@hidden
Motorola CRM                                 +33 1 69 35 48 04 (Ph) 
Parc Les Algorithmes, Commune de St Aubin    +33 1 69 35 77 01 (Fax) 
91193 Gif-Sur-Yvette FRANCE

The information contained in this communication has been classified as: 

[x] General Business Information 
[ ] Motorola Internal Use Only 
[ ] Motorola Confidential Proprietary



reply via email to

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