referencing subfunctions
Christian Böhme
monodhs at gmx.de
Thu Jun 11 16:54:48 CDT 2009
Jaroslav Hajek wrote:
> Can you provide an example of what does not work for you?
Please see the attached files (map() is the algorithm invoked
by either broken() or working() both of which accept an arbitrary
number as their sole argument).
It appears that - even though section 12.7.2 of the current Octave
docs does not rule it out per se, ie, that subfunctions may indeed
reference other subfunctions - there is some sort of function
definition/visibility nesting level involved with the way function
files are parsed, which is majorly disturbing to say the least.
Syntactically, all functions including the one whose name is
identical to the file's name are on one and the same level yet
f() does not appear to be visible to any function (including the
anonymous ones) other than broken().
> AFAIK,
> there are no such special tricks in fsolve (note that it is reimplemented
> in 3.2.0),
Turns out that it has nothing to do with fsolve() but with the way
symbols are made available to other scopes/translation/interpretation
units.
> so most likely you either see a bug or you're doing
> something wrong.
Maybe, depending on your definition of "wrong" ;)
Cheers,
Christian
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: broken.m
Url: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20090611/548386ac/attachment.ksh
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: working.m
Url: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20090611/548386ac/attachment-0001.ksh
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: map.m
Url: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20090611/548386ac/attachment-0002.ksh
More information about the Help-octave
mailing list