octave-maintainers
[Top][All Lists]
Advanced

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

Re: improved compatibility


From: John W. Eaton
Subject: Re: improved compatibility
Date: Wed, 9 Jul 2003 21:04:00 -0500

On  9-Jul-2003, Paul Kienzle <address@hidden> wrote:

| Okay, but we may still want to save-set-restore
| the warning value inside a script that would
| produce a warning in the usual case.  The easiest
| solution is to have warning(value, id) return the
| previous value.

Yes, that's what Matlab does as well, so you can see what the previous
warning state is.  Octave also does this for the current

  warning (state)

call so that you can also restore the global warning state (on or off).

| That gives us the equivalent of
| what we've got now, so I don't see it reducing
| the use of unwind_protect blocks in our code.

No, but it does elimiate a bunch of built-in variables, which I think
would be a good thing.

| Maybe if we could shut off warnings just for
| the current function?

My first thought was that it could be done with an implicit unwind
protect block that saves and restores the warning state, but if you
want it to apply to only the current function and not any functions
called by the current function, then it would be a little more complex
than just setting the one and only global warning state.

| Sometimes I implement the equivalent of
| warning('once','message_id') when I only
| want one warning during the session.

This would also be a useful option in addition to the 'on' and 'off'
states allowed by Matlab.

jwe



reply via email to

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