changeset 2918:c8e635ff1af4

[project @ 1997-04-30 21:41:08 by jwe]
author jwe
date Wed, 30 Apr 1997 21:41:46 +0000
parents 5c285800ebe2
children 56a24fd3e6d9
files NEWS liboctave/Array-idx.h
diffstat 2 files changed, 66 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,65 @@
-Summary of changes for version 2.1:
-----------------------------------
+Summary of changes since version 2.0.5:
+--------------------------------------
+
+  * New operators.  Octave's parser now recognizes the following
+    operators:  << >> += -= *= /= .+= .-= .*= ./= &= |= <<= >>=.  So
+    far, there are only a few operations defined that actually use
+    them (this should change before 2.1 is released).
+
+  * New built-in data types:
+
+    logical:
+
+      A true value is represented by 1, and false value by 0.
+      Comparison operations like <, <=, ==, >, >=, and != now return
+      logical values.  Indexing operations that use zero-one style
+      indexing must now use logical values.  You can use the new
+      function logical() to convert a numeric value to a logical
+      value.  This avoids the need for the built-in variable
+      `prefer_zero_one_indexing', so it has been removed.  Logical
+      values are automatically converted to numeric values where
+      appropriate.
+
+    file:
+
+      A file object represents an open Octave stream object.  The
+      fopen function now returns a file object instead of an integer.
+      File objects can be converted to integers automatically, and the
+      other functions that work with file ids still work with
+      integers, so this change should be backward compatible.
+
+      The binary left-shift operator `<<' has been defined to work as
+      in C++ for file objects and built-in types.  For example,
+
+        my_stream = fopen ("foo", "w");
+        my_stream << "x = " << pi << " marks the spot\n";
+
+      writes `x = 3.14159 marks the spot' in the file foo.
+
+      The built-in variables stdin, stdout, and stderr are now also
+      file objects instead of integers.
+
+    list:
+
+      A list is an array of Octave objects.  It can be indexed using
+      the normal indexing operator.  For example,
+
+        x = make_list ([1,2;3,4], 1, "foo");
+        stdout << x(2) << "\n"
+        1
+        stdout << x;
+        (
+         [1] =
+        
+           1  2
+           3  4
+        
+          [2] = 1
+          [3] = foo
+        )
+
+      There is currently no special syntax for creating lists; you
+      must use the make_list function.
 
   * Commas in global statements are no longer special.  They are now
     treated as command separators.  This removes a conflict in the
@@ -28,16 +88,6 @@
     Lapack subroutine for symmetric matrices for a significant
     increase in performance.
 
-  * Octave now has a logical data type.  A true value is represented
-    by 1, and false value by 0.  Comparison operations like <, <=, ==,
-    >, >=, and != now return logical values.  Indexing operations that
-    use zero-one style indexing must now use logical values.  You can
-    use the new function logical() to convert a numeric value to a
-    logical value.  This avoids the need for the built-in variable
-    `prefer_zero_one_indexing', so it has been removed.  Logical
-    values are automatically converted to numeric values where
-    appropriate.
-
   * If the argument to lsode that names the user-supplied function is
     a 2-element string array, the second element is taken as the name
     of the Jacobian function.  The named function should have the
--- a/liboctave/Array-idx.h
+++ b/liboctave/Array-idx.h
@@ -139,6 +139,9 @@
 	      {
 		iidx++;
 		new_len--;
+
+		if (iidx == num_to_delete)
+		  break;
 	      }
 
 	  if (new_len > 0)
@@ -149,7 +152,7 @@
 	      iidx = 0;
 	      for (int i = 0; i < len; i++)
 		{
-		  if (i == idx.elem (iidx))
+		  if (iidx < num_to_delete && i == idx.elem (iidx))
 		    iidx++;
 		  else
 		    {