help-octave
[Top][All Lists]
Advanced

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

Re: mkoctfile: Problems sometimes during linking of text file


From: Joao Cardoso
Subject: Re: mkoctfile: Problems sometimes during linking of text file
Date: Thu, 27 Apr 2000 02:39:09 +0100

"John W. Eaton" wrote:
> 
> On 20-Apr-2000, Stef Pillaert <address@hidden> wrote:
...
> | And a second tought: it would even be greater if the need for making the
> | symbolic links wouldn't be necesarry any more: just having one lib, with all
> | the functions in it, that can be called from octave. Is this possible, or
> | unrealistic?
> 
> How would Octave know what functions are in the library?  Design a
> clean and efficient way to do it that works well with the current
> autoloading scheme (inherited from Matlab, for better or worse),

Hi,

I think that the advantages of a one-file/multiple-functions are
obvious. Humm... simpler to maintain, at least. And more elegant, for
sure!

And it would be enough to add to Octave a procedure to register other
existing functions in the file.

E.g., a minmax.cc function should contain:

  DEFUN_DLD (min, args, nargout,
  ...
  DEFUN_DLD (max, args, nargout,
  ...
  DEFUN_DLD (minmax, args, nargout,
    // register max() and min() as existing in this file
    REGFUN("max");
    REGFUN("min");
  ...

and should be named minmax.oct.

Of course this implies explicit user initialization, that could be left
in ".octaverc". No free lunch! But compatible.

> implement it, and submit it.

Arghh! "touché"

>  But why bother?  Don't links work well
> enough?

Perhaps not. And I think that this has been already addressed in this
mailing list.

If my multi-function file has to keep an internal global state variable,
"static int state", e.g., with file linking the "state" variable will be
local to each linked file/function, not global to all defined functions.
For simple variables, one could use "set/get_global_value", but for
complex structures...

Joao

> 
> jwe

---
My dream: "cat | asm"



-----------------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.che.wisc.edu/octave/octave.html
How to fund new projects:  http://www.che.wisc.edu/octave/funding.html
Subscription information:  http://www.che.wisc.edu/octave/archive.html
-----------------------------------------------------------------------



reply via email to

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