changeset 14546:b8edefd8c111

NEWS: Expand section on nested functions and clarify regexprep changes. * NEWS: Expand section on nested functions and clarify regexprep changes.
author Rik <octave@nomad.inbox5.com>
date Tue, 10 Apr 2012 22:52:41 -0700
parents 1f922eedf9ce
children 1bf39e944e43
files NEWS
diffstat 1 files changed, 28 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,32 @@
 Summary of important user-visible changes for version 3.8:
 ---------------------------------------------------------
 
+ ** Octave now supports nested functions with scoping rules that are
+    compatible with Matlab.  A nested function is one declared and defined
+    within the body of another function.  The nested function is only
+    accessible from within the enclosing function which makes it one
+    method for making private functions whose names do not conflict with those
+    in the global namespace (See also subfunctions and private functions).
+    In addition, variables in the enclosing function are visible within the
+    nested function.  This makes it possible to have a pseudo-global variable
+    which can be seen by a group of functions, but which is not visible in
+    the global namespace.
+    
+    Example:
+    function outerfunc (...)
+      ...
+      function nested1 (...)
+        ...
+        function nested2 (...)
+           ...
+        endfunction
+      endfunction
+
+      function nested3 (...)
+        ...
+      endfunction
+    endfunction
+
  ** 'emptymatch', 'noemptymatch' options added to regular expressions.
 
     With this addition Octave now accepts the entire set of Matlab options
@@ -15,11 +41,8 @@
 
  ** For compatibility with Matlab, the regexp, regexpi, and regexprep
     functions now process backslash escapes in single-quoted pattern
-    strings.  The regexprep function now processes backslash escapes in
-    single-quoted replacement strings.
-
- ** Octave now supports nested functions with scoping rules that are
-    compatible with Matlab.
+    strings.  In addition, the regexprep function now processes backslash
+    escapes in single-quoted replacement strings.
 
  ** Redundant terminal comma accepted by parser