octave-maintainers
[Top][All Lists]
Advanced

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

Re: oct2mat script based on parse tree


From: John W. Eaton
Subject: Re: oct2mat script based on parse tree
Date: Wed, 09 Jan 2008 14:08:18 -0500

On  9-Jan-2008, Muthiah Annamalai wrote:

| John W. Eaton wrote:
| 
| > There are some vague plans to make Octave parse entire script files at
| > once and build a list of commands (see the unfinished ov_user_script
| > class in src/ov-usr-fcn.h).  If that work is completed, then handling
| > scripts should be much simplified.
| 
| Thanks!

That doesn't mean that I'm planning to do the work myself.  My point
is that it is a desirable thing to do.  You might look at what would
be necessary to do this work yourself, and submit patches for it.

| > You should probably issue a warning any time you encounter an
| > unwind_protect block.  Silently omitting the keywords for the unwind
| > protect block is misleading.  Although the code will appear to work
| > correctly when it is executed with no errors or other exceptions
| > occuring in the first block of code, it could really cause some
| > confusing results or resource leaks if there is an error or exception.
| 
| I handled that piece of code wrongly. Paul Kienzle treats that
| by converting unwind_protect piece of code into a try-catch
| statement.

Silently converting unwind_protect to try-catch is not the right thing
to do either.  These statements have different semantics (if they were
the same, we would not need unwind_protect).  The cleanup code in an
unwind_protect statement is always executed, no matter what happens in
the first block of the statement (normal execution, error, interrupt).
The catch block in a try-catch statement is only executed if an error
occurs in the try block, and an interrupt is not considered an error.

jwe


reply via email to

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