[Top][All Lists]

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

writing nested functions

From: John W. Eaton
Subject: writing nested functions
Date: Tue, 1 Feb 2000 14:42:53 -0600 (CST)

On  1-Feb-2000, Ross A. Lippert <address@hidden> wrote:

| Hi.  I'm writing a convex hull function which calls several
| subfunctions.  I am looking in the .m scripts that comes with
| octave and trying to find an example where several functions
| are defined in a script, the top definition being the one external
| and the other defn's being local only to that script, you know
| sorta the way matlab 5 (and maybe matlab 4) does it.

Octave doesn't support this feature.  I don't know when (if ever) it

| Do I have to have one file per function?  I ask this because this
| makes me choose between inlining my functions and decreasing
| readability, or creating separate files and then having a bunch
| of functions callable by the user that the user has no business
| calling.

For now, use __some_name__ for `private' functions, but define them in
separate files (that's the way other parts of Octave currently work).
These functions do not really have private scope, but the Octave
manual does say that names beginning and ending with double
underscores are not generally for user consumption.


reply via email to

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