Mercurial > hg > octave-lyh
diff scripts/optimization/__all_opts__.m @ 8652:b93f17317ca3
fixes to __all_opts__
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Tue, 03 Feb 2009 08:32:28 +0100 |
parents | 06f5dd901f30 |
children | e07e93c04080 |
line wrap: on
line diff
--- a/scripts/optimization/__all_opts__.m +++ b/scripts/optimization/__all_opts__.m @@ -26,14 +26,20 @@ persistent saved_names = {}; + ## do not clear this function + mlock (); + ## guard against recursive calls. persistent recursive = false; - if (nargin == 0) + if (recursive) + names = {}; + elseif (nargin == 0) names = saved_names; else ## query all options from all known functions. These will call optimset, ## which will in turn call us, but we won't answer. + recursive = true; names = saved_names; for i = 1:nargin try @@ -52,6 +58,7 @@ error ("__all_opts__: duplicate options with inconsistent case."); endif saved_names = names; + recursive = false; endif endfunction