[Top][All Lists]

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

Re: Calling other functions from .oct files

From: John W. Eaton
Subject: Re: Calling other functions from .oct files
Date: Thu, 1 May 2003 21:49:38 -0500

On  1-May-2003, Paul Kienzle <address@hidden> wrote:

| You could always buffer your random numbers in your
| simulation so that the overhead of feval is insignificant.

Yes, I suppose that would have been possible, but it didn't seem as
convenient, and besides, it was a good excuse for making rand
available in liboctave, which I had wanted to do for a while.

| On the other hand you should be able to call
| the computational stuff from another oct-file directly so
| that things in liboctave don't have special status.  In
| principle it is easy enough.

Sure, you could load the .oct file and get a pointer to the function
you need.  The problem with this is that it fails if someone clears
the function you just loaded, though I suppose you could get around
that if you didn't have a pointer to the function, but some other
object that could (efficiently) give you a pointer to the function,
but would also know if it needed to reload the function.

(Maybe it should not be possible to clear or reload .oct files, but
that's not the way things currently work.)

Also, I think your code will stop working if someone rewrites the .oct
file as a .m file, but again, it might be possible to work around that
with a smart object instead of a direct function pointer.  I guess
what I'm trying to describe is a kind of feval object that caches the
function pointer in a smart way.


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

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

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