help-octave
[Top][All Lists]
Advanced

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

Re: Sharing auxilary functions


From: John W. Eaton
Subject: Re: Sharing auxilary functions
Date: Fri, 17 Jun 2005 14:40:37 -0400

On 17-Jun-2005, Søren Hauberg wrote:

| Sounds a bit like it. However something simpler should do the trick. In 
| C I would simply #include the file I need to share. Can I somehow parse 
| a file containing functions without calling any of them?

Yes, you can "source" the file, but I think you would need to do taht
before calling any of the main functions you are using.  Also, the
functions defined in the file you "sourced" would be globally visible.

If you want the functions defined in the file that you are
"sourcing" to be subfunctions of another function, then calling source
won't help you because the parser needs to see the code for the
subfunctions when it is parsing the main function, and a line like

  source ("my_functions.m");

is not special (it just looks like another symbol reference to the
parser).  Does that help?

jwe



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

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



reply via email to

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