On Fri, Jan 9, 2009 at 12:56 PM, Søren Hauberg <so...@hauberg.org> wrote:
> Your accessor functions all seem to follow the same structure. An
> example is 'ML_REFFREQ' which looks like this:
>
>    mlock();
>    try
>        ml_reffreq;
>    catch
>        persistent ml_reffreq = 440;
>    end
>    old = ml_reffreq;
>    if (nargin == 1)
>        ml_reffreq = new;
>    endif
>
> I don't see why you need the try-catch block. Doesn't the following
> work:
>
>    mlock();
>    persistent ml_reffreq = 440;
>    old = ml_reffreq;
>    if (nargin == 1)
>        ml_reffreq = new;
>    endif
>
> ?

Doesn't that always set the value to the default, unless you give it a
new value?  Then you can't read the current value without making it
global.

-- 
Thanks,

Jonathan Kotta

Hofstadter's Law:
    It always takes longer than you expect, even
    when you take into account Hofstadter's Law.
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to