[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: local functions in file
From: |
Victor Eijkhout |
Subject: |
Re: local functions in file |
Date: |
Fri, 2 Aug 2002 10:13:16 -0400 |
At 17:40 -0500 2002/08/01, John W. Eaton wrote:
function f1 (..)
...
function f2 (..)
...
function f3 (...)
...
endfunction
...
function f4 (...)
...
endfunction
...
endfunction
...
endfunction
As I see it, f3 and f4 would only be visible in f2, and f2 would only
be visible in f1 (although I suppose it would also make some sense to
be able to call f2 recursively from f3 or f4).
That would make sense, and it's how languages such as Pascal do it.
However, for compatibility with Matlab I personally would prefer it
if you implemented their interpretation. Which is slightly ugly, with
the lack of 'end of function' keyword, and will make your nested
functions harder to implement as you already observed.
--
Victor Eijkhout <address@hidden>
tel: 865 974 9308 (W), 865 673 6998 (H), 865 974 8296 (F)
http://www.cs.utk.edu/~eijkhout/
-------------------------------------------------------------
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
-------------------------------------------------------------