octave-maintainers
[Top][All Lists]
Advanced

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

Re: test failures with current mercurial sources (was Re: 3.0.1 release?


From: John W. Eaton
Subject: Re: test failures with current mercurial sources (was Re: 3.0.1 release?)
Date: Thu, 03 Apr 2008 10:49:56 -0400

On  3-Apr-2008, David Bateman wrote:

| How do we do this in a way that is called once.. Imagine a deprecated
| function in the inner loop of a function that is called 1000s of times.
| Is there an existing mechanism to make the warning only appear once
| before we come back to the prompt or do we need some like
| 
| persistent warned = false;
| if (! warned)
|   warned = true;
|   warning ("Octave:deprecated-function",
|      "OLD-FCN is obsolete and will be removed from Octave VERSION;
| please use NEW-FCN instead");
| endif
| 
| I don't consider that its a good idea to have this warning off by
| default, and then the warning doesn't serve its purpose.

Yes, I agree that it should only appear once.  I don't see a better
way than the one you show above.  I first thought of having something
like

  PKG_ADD: warning ("once", "Octave:deprecated-function");

but that would apply to all warnings tagged with
Octave:deprecated-function, so we would need to choose unique tags.
We could use Octave:FCN-deprecated instead to make them unique.  Would
that be better?  It might apply to other functions, so implementing
the "once" feature for warning might be useful enough to justify the
effort.  What do you think?

jwe



reply via email to

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