octave-maintainers
[Top][All Lists]
Advanced

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

Re: Merging Octave and Octave-Forge?


From: Jaroslav Hajek
Subject: Re: Merging Octave and Octave-Forge?
Date: Wed, 27 Aug 2008 21:26:46 +0200

On Wed, Aug 27, 2008 at 9:12 PM, John W. Eaton <address@hidden> wrote:
> On 27-Aug-2008, Levente Torok wrote:
>
> | In the lack of explicit importing possiblity (opposed to languages as 
> python...)
> | Basicaly I vote to have nancov ... as in matlab.
> | However in addition to this I would probably like to have a global variable 
> (or global switch, or name it anything you like)
> | by which I can use the nan functionality without rewriting my code.
> |
> | How do you like this idea?
>
> Not so much.  We used to have a number of global variables in Octave
> that did this sort of thing.  It sounds like a great idea at first,
> but then you set a variable the way to prefer and call some code that
> expects the variable to have a different value you potentially get the
> wrong result without any warning.
>

I strongly agree with John here. It sounds like a good idea at first
glance, and it perhaps works well if you write functions just for
personal (or small-group) use, but the it gets bad. After introducing
such a variable, you must write robust functions in a different way.
You should assume that the flag can be in any state on entry, save its
state, set to what you need, and reset on exit (even error exit). Man,
it gets complicated. In fact, it's much easier to just run all code
through sed and replace the stats functions with their nan
counterparts. Alternatively, you can use function handles to override
the default functions *locally* to achieve the same goal you would do
with the global flag.

> jwe
>



-- 
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz


reply via email to

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