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

John W. Eaton jwe at bevo.che.wisc.edu
Thu Apr 3 09:49:56 CDT 2008


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



More information about the Octave-maintainers mailing list