octave-maintainers
[Top][All Lists]
Advanced

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

Documentation for try and unwind_protect


From: Bill Denney
Subject: Documentation for try and unwind_protect
Date: Tue, 31 Oct 2006 00:26:23 -0500
User-agent: Thunderbird 1.5.0.7 (Windows/20060909)

Here is a bit of documentation for try and unwind_protect. I may have sent this before, but I didn't see it in a quick search and it's not committed.

Bill

src/ChangeLog:

2006-10-31  Bill Denney  <address@hidden>
   * help.cc: add documentation for try and unwind_protect
Index: help.cc
===================================================================
RCS file: /cvs/octave/src/help.cc,v
retrieving revision 1.166
diff -u -r1.166 help.cc
--- help.cc     26 Oct 2006 15:56:30 -0000      1.166
+++ help.cc     31 Oct 2006 05:24:05 -0000
@@ -452,7 +452,12 @@
     "-*- texinfo -*-\n\
 @deffn Keyword try\n\
 Begin a try-catch block.\n\
address@hidden
+\n\
+If an error occurs within a try block, then the catch code will be run and\n\
+execution will proceed after the catch block (though it is often\n\
+recommended to use the lasterr function to re-throw the error after cleanup\n\
+is completed).\n\
address@hidden,unwind_protect}\n\
 @end deffn", }, 
 
   { "until",
@@ -466,7 +471,14 @@
     "-*- texinfo -*-\n\
 @deffn Keyword unwind_protect\n\
 Begin an unwind_protect block.\n\
address@hidden
+\n\
+If an error occurs within the first part of an unwind_protect block\n\
+the commands within the unwind_protect_cleanup block are executed before\n\
+the error is thrown.  If an error is not thrown, then the\n\
+unwind_protect_cleanup block is still executed (in other words, the\n\
+unwind_protect_cleanup will be run with or without an error in the\n\
+unwind_protect block).\n\
address@hidden,try}\n\
 @end deffn", }, 
 
   { "unwind_protect_cleanup",

reply via email to

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