changeset 9689:34d6f005db4b

eliminate is_string argument from octave_value character array constructors
author John W. Eaton <jwe@octave.org>
date Mon, 05 Oct 2009 00:11:07 -0400
parents 90abfd8a2895
children f42f0d707e8e
files src/ChangeLog src/DLD-FUNCTIONS/hex2num.cc src/DLD-FUNCTIONS/typecast.cc src/data.cc src/ls-oct-ascii.cc src/mex.cc src/oct-stream.cc src/ops.h src/ov-base-int.cc src/ov-base.cc src/ov-base.h src/ov-ch-mat.cc src/ov-ch-mat.h src/ov-re-mat.cc src/ov-re-sparse.cc src/ov-str-mat.cc src/ov-str-mat.h src/ov.cc src/ov.h src/pt-mat.cc
diffstat 20 files changed, 253 insertions(+), 163 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Sun Oct 04 01:04:29 2009 -0400
+++ b/src/ChangeLog	Mon Oct 05 00:11:07 2009 -0400
@@ -1,3 +1,70 @@
+2009-10-05  John W. Eaton  <jwe@octave.org>
+
+	* ov.h (octave_value (const charMatrix&, char, bool),
+	octave_value (const charNDArray&, char, bool),
+	octave_value (const ArrayN<char>&, char, bool)):
+	New constructor decls.
+	(octave_value (const charMatrix&, bool, char),
+	octave_value (const charNDArray&, bool, char),
+	octave_value (const ArrayN<char>&, bool, char)): Mark with
+	GCC_ATTR_DEPRECATED.  Single-quoted strings are now default string
+	type.
+	(octave_value::convert_to_str): Default is single-quoted strings.
+	* ov.cc (octave_value (const charMatrix&, char, bool),
+	octave_value (const charNDArray&, char, bool),
+	octave_value (const ArrayN<char>&, char, bool)): New constructors.
+	(octave_value (const charMatrix&, bool, char),
+	octave_value (const charNDArray&, bool, char),
+	octave_value (const ArrayN<char>&, bool, char)):
+	Assume is_string argument is always true.
+
+	* ov-re-mat.cc (octave_sparse_matrix::convert_to_str_internal):
+	Update for octave_value constructore changes.
+	* ov-ch-mat.h (octave_char_matrix::convert_to_str_internal): Likewise.
+	* ov-re-sparse.cc (octave_sparse_matrix::convert_to_str_internal):
+	Likewise.
+	* ov-str-mat.h (octave_char_matrix_str::squeeze,
+	octave_char_matrix_str::reshape, octave_char_matrix_str::permute,
+	octave_char_matrix_str::diag, octave_char_matrix_str::sort,
+	octave_char_matrix_sq_str::squeeze,
+	octave_char_matrix_sq_str::reshape,
+	octave_char_matrix_sq_str::permute,
+	octave_char_matrix_sq_str::diag, octave_char_matrix_sq_str::sort):
+	Likewise.
+	* ov-str-mat.cc (octave_char_matrix_str::do_index_op_internal):
+	Likewise.
+	(octave_char_matrix_str::resize): Likewise.
+	* data.cc (do_cat, Fmerge): Likewise.
+	* ops.h (DEFNDCHARCATOP_FN): Likewise.
+	* ov-base-int.cc (octave_base_int_matrix<T>::convert_to_str_internal):
+	Likewise.
+	* pt-mat.cc (tree_matrix::rvalue1): Likewise.
+
+	* ov-ch-mat.h (octave_char_matrix::octave_char_matrix): Delete
+	unused bool arg.  Declare constructors protected.
+
+	(xisalnum, xisalpha, xisascii, xiscntrl, xisdigit, xisgraph,
+	xislower, xisprint, xispunct, xisspace, xisupper, xisxdigit,
+	xtoascii, xtolower, xtoupper): Move decls here from ov-str-mat.h.
+	(MAT_MAPPER, BOOL_MAT_MAPPER): Move macro definitions and uses
+	here from ov-str-mat.h.
+
+	* ov-ch-mat.cc (MACRO_WRAPPER, STRING_MAPPER, TOSTRING_MAPPER):
+	Move macro definitions and uses here.
+	* ov-str-mat.cc: From here.
+
+	* DLD-FUNCTIONS/typecast (Ftypecast): Update for octave_value
+	constructor changes.  Create sq_string unless casting from string,
+	then preserve exact type.
+	(Fbitpack): Update for octave_value constructor changes.  Create
+	sq_string.
+	* DLD-FUNCTIONS/hex2num.cc (Fnum2hex): Update for octave_value
+	constructor changes.  Create sq_string.
+	* ls-oct-ascii.cc (read_ascii_data): Likewise.
+	* mex.cc (mxArray_number::as_octave_value): Likewise.
+	* oct-stream.cc (octave_stream::read): Likewise.
+	* ov-base.cc (STRING_MAPPER): Likewise.
+
 2009-10-04  John W. Eaton  <jwe@octave.org>
 
 	* ov-str-mat.h (octave_char_matrix_str::squeeze,
--- a/src/DLD-FUNCTIONS/hex2num.cc	Sun Oct 04 01:04:29 2009 -0400
+++ b/src/DLD-FUNCTIONS/hex2num.cc	Mon Oct 05 00:11:07 2009 -0400
@@ -177,8 +177,8 @@
 		  m.elem (i, j) = ch;
 		}
 	    }
-	  
-	  retval = octave_value (m, true);
+
+	  retval = m;
 	}
     }
 
--- a/src/DLD-FUNCTIONS/typecast.cc	Sun Oct 04 01:04:29 2009 -0400
+++ b/src/DLD-FUNCTIONS/typecast.cc	Mon Oct 05 00:11:07 2009 -0400
@@ -188,7 +188,7 @@
       if (error_state || numclass.size () == 0)
         ;
       else if (numclass == "char")
-        retval = octave_value (reinterpret_copy<charNDArray> (data, byte_size, old_dims), true);
+        retval = octave_value (reinterpret_copy<charNDArray> (data, byte_size, old_dims), array.is_dq_string () ? '"' : '\'');
       else if (numclass[0] == 'i')
         {
           if (numclass == "int8")
@@ -304,7 +304,7 @@
       if (error_state || numclass.size () == 0)
         ;
       else if (numclass == "char")
-        retval = octave_value (do_bitpack<charNDArray> (bitp), true);
+        retval = octave_value (do_bitpack<charNDArray> (bitp), '\'');
       else if (numclass[0] == 'i')
         {
           if (numclass == "int8")
--- a/src/data.cc	Sun Oct 04 01:04:29 2009 -0400
+++ b/src/data.cc	Mon Oct 05 00:11:07 2009 -0400
@@ -1918,7 +1918,7 @@
 
 	      SINGLE_TYPE_CONCAT (charNDArray, char_array_value);
 
-	      retval = octave_value (result, true, type);
+	      retval = octave_value (result, type);
 	    }
 	  else if (result_type == "logical")
 	    {
@@ -6151,8 +6151,7 @@
               retval = octave_value (do_merge (mask,
                                                tval.char_array_value (),
                                                fval.char_array_value ()),
-                                     true, sq_string ? '\'' : '"');
-
+                                     sq_string ? '\'' : '"');
             }
           else if (tval.is_cell () && fval.is_cell ())
             {
--- a/src/ls-oct-ascii.cc	Sun Oct 04 01:04:29 2009 -0400
+++ b/src/ls-oct-ascii.cc	Mon Oct 05 00:11:07 2009 -0400
@@ -278,7 +278,7 @@
 
       // Special case for backward compatiablity. A small bit of cruft
       if (SUBSTRING_COMPARE_EQ (typ, 0, 12, "string array"))
-	tc = octave_value (charMatrix (), true);
+	tc = charMatrix ();
       else
 	tc = octave_value_typeinfo::lookup_type (typ);
 
--- a/src/mex.cc	Sun Oct 04 01:04:29 2009 -0400
+++ b/src/mex.cc	Mon Oct 05 00:11:07 2009 -0400
@@ -1341,7 +1341,7 @@
 	  for (mwIndex i = 0; i < nel; i++)
 	    ptr[i] = static_cast<char> (ppr[i]);
 
-	  retval = octave_value (val, true, '\'');
+	  retval = val;
 	}
 	break;
 
--- a/src/oct-stream.cc	Sun Oct 04 01:04:29 2009 -0400
+++ b/src/oct-stream.cc	Mon Oct 05 00:11:07 2009 -0400
@@ -3368,7 +3368,7 @@
 		      && (output_type == oct_data_conv::dt_char
 			  || output_type == oct_data_conv::dt_schar
 			  || output_type == oct_data_conv::dt_uchar))
-		    retval = octave_value (retval.char_matrix_value (), true);
+		    retval = retval.char_matrix_value ();
 		}
 	      else
 		error ("fread: unable to read and convert requested types");
--- a/src/ops.h	Sun Oct 04 01:04:29 2009 -0400
+++ b/src/ops.h	Mon Oct 05 00:11:07 2009 -0400
@@ -381,8 +381,8 @@
     CAST_BINOP_ARGS (CONCAT2(octave_, t1)&, const CONCAT2(octave_, t2)&); \
  \
     return octave_value (v1.char_array_value () . f (v2.char_array_value (), ra_idx), \
-			 true, ((a1.is_sq_string () || a2.is_sq_string ()) \
-				? '\'' : '"')); \
+			 ((a1.is_sq_string () || a2.is_sq_string ()) \
+			  ? '\'' : '"')); \
   }
 
 // For compatibility, the second arg is always converted to the type
--- a/src/ov-base-int.cc	Sun Oct 04 01:04:29 2009 -0400
+++ b/src/ov-base-int.cc	Mon Oct 05 00:11:07 2009 -0400
@@ -172,7 +172,7 @@
 	chm (i) = static_cast<char> (ival);
     }
 
-  retval = octave_value (chm, true, type);
+  retval = octave_value (chm, type);
 
   return retval;
 }
--- a/src/ov-base.cc	Sun Oct 04 01:04:29 2009 -0400
+++ b/src/ov-base.cc	Mon Oct 05 00:11:07 2009 -0400
@@ -1166,7 +1166,7 @@
   octave_value \
   octave_base_value::F (void) const \
   { \
-    octave_value tmp = octave_value (char_array_value (true), true); \
+    octave_value tmp = char_array_value (true); \
     return error_state ? octave_value () : octave_value (tmp.F ()); \
   }
 
--- a/src/ov-base.h	Sun Oct 04 01:04:29 2009 -0400
+++ b/src/ov-base.h	Mon Oct 05 00:11:07 2009 -0400
@@ -537,7 +537,7 @@
   virtual octave_value_list list_value (void) const;
 
   virtual octave_value convert_to_str (bool pad = false, bool force = false,
-				       char type = '"') const;
+				       char type = '\'') const;
   virtual octave_value
   convert_to_str_internal (bool pad, bool force, char type) const;
 
--- a/src/ov-ch-mat.cc	Sun Oct 04 01:04:29 2009 -0400
+++ b/src/ov-ch-mat.cc	Mon Oct 05 00:11:07 2009 -0400
@@ -155,6 +155,45 @@
   return retval;
 }
 
+#define MACRO_WRAPPER(FCN, CTYPE_FCN) \
+  static int x ## FCN (int c) { return CTYPE_FCN (c); }
+
+#define STRING_MAPPER(FCN, AMAP, CTYPE_FCN) \
+  MACRO_WRAPPER (FCN, CTYPE_FCN) \
+ \
+  octave_value \
+  octave_char_matrix::FCN (void) const \
+  { \
+    static charNDArray::mapper smap = x ## FCN; \
+    return matrix.AMAP (smap);  \
+  }
+
+#define TOSTRING_MAPPER(FCN, AMAP, CTYPE_FCN) \
+  MACRO_WRAPPER (FCN, CTYPE_FCN) \
+ \
+  octave_value \
+  octave_char_matrix::FCN (void) const \
+  { \
+    static charNDArray::mapper smap = x ## FCN; \
+    return octave_value (matrix.AMAP (smap), is_sq_string () ? '\'' : '"'); \
+  }
+
+STRING_MAPPER (xisalnum, bmap, isalnum)
+STRING_MAPPER (xisalpha, bmap, isalpha)
+STRING_MAPPER (xisascii, bmap, isascii)
+STRING_MAPPER (xiscntrl, bmap, iscntrl)
+STRING_MAPPER (xisdigit, bmap, isdigit)
+STRING_MAPPER (xisgraph, bmap, isgraph)
+STRING_MAPPER (xislower, bmap, islower)
+STRING_MAPPER (xisprint, bmap, isprint)
+STRING_MAPPER (xispunct, bmap, ispunct)
+STRING_MAPPER (xisspace, bmap, isspace)
+STRING_MAPPER (xisupper, bmap, isupper)
+STRING_MAPPER (xisxdigit, bmap, isxdigit)
+STRING_MAPPER (xtoascii, dmap, toascii)
+TOSTRING_MAPPER (xtolower, smap, tolower)
+TOSTRING_MAPPER (xtoupper, smap, toupper)
+
 /*
 ;;; Local Variables: ***
 ;;; mode: C++ ***
--- a/src/ov-ch-mat.h	Sun Oct 04 01:04:29 2009 -0400
+++ b/src/ov-ch-mat.h	Mon Oct 05 00:11:07 2009 -0400
@@ -34,9 +34,10 @@
 #include "str-vec.h"
 
 #include "error.h"
+#include "ov.h"
 #include "ov-base.h"
-
 #include "ov-base-mat.h"
+#include "ov-re-mat.h"
 #include "ov-typeinfo.h"
 
 class Octave_map;
@@ -49,15 +50,15 @@
 class
 octave_char_matrix : public octave_base_matrix<charNDArray>
 {
-public:
+protected:
 
   octave_char_matrix (void)
     : octave_base_matrix<charNDArray> () { }
 
-  octave_char_matrix (const charMatrix& chm, bool = false)
+  octave_char_matrix (const charMatrix& chm)
     : octave_base_matrix<charNDArray> (chm) { }
 
-  octave_char_matrix (const charNDArray& chm, bool = false)
+  octave_char_matrix (const charNDArray& chm)
     : octave_base_matrix<charNDArray> (chm) { }
 
   octave_char_matrix (char c)
@@ -75,6 +76,8 @@
   octave_char_matrix (const octave_char_matrix& chm)
     : octave_base_matrix<charNDArray> (chm) { }
 
+public:
+
   ~octave_char_matrix (void) { }
 
   octave_base_value *clone (void) const { return new octave_char_matrix (*this); }
@@ -134,12 +137,62 @@
     { return matrix; }
 
   octave_value convert_to_str_internal (bool, bool, char type) const
-    { return octave_value (matrix, true, type); }
+    { return octave_value (matrix, type); }
 
   void print_raw (std::ostream& os, bool pr_as_read_syntax = false) const;
 
   mxArray *as_mxArray (void) const;
 
+  octave_value xisalnum (void) const;
+  octave_value xisalpha (void) const;
+  octave_value xisascii (void) const;
+  octave_value xiscntrl (void) const;
+  octave_value xisdigit (void) const;
+  octave_value xisgraph (void) const;
+  octave_value xislower (void) const;
+  octave_value xisprint (void) const;
+  octave_value xispunct (void) const;
+  octave_value xisspace (void) const;
+  octave_value xisupper (void) const;
+  octave_value xisxdigit (void) const;
+  octave_value xtoascii (void) const;
+  octave_value xtolower (void) const;
+  octave_value xtoupper (void) const;
+
+#define MAT_MAPPER(MAP) \
+  octave_value MAP (void) const \
+    { \
+      octave_matrix m (array_value (true)); \
+      return m.MAP (); \
+    }
+
+  MAT_MAPPER (abs)
+  MAT_MAPPER (angle)
+  MAT_MAPPER (arg)
+  MAT_MAPPER (ceil)
+  MAT_MAPPER (conj)
+  MAT_MAPPER (fix)
+  MAT_MAPPER (floor)
+  MAT_MAPPER (imag)
+  MAT_MAPPER (real)
+  MAT_MAPPER (round)
+  MAT_MAPPER (signum)
+
+#undef MAT_MAPPER
+
+#define BOOL_MAT_MAPPER(MAP, VAL)	\
+  octave_value MAP (void) const \
+    { \
+      return boolNDArray (matrix.dims (), VAL); \
+    }
+
+  BOOL_MAT_MAPPER (finite, true)
+  BOOL_MAT_MAPPER (isinf, false)
+  BOOL_MAT_MAPPER (isna, false)
+  BOOL_MAT_MAPPER (isnan, false)
+
+#undef BOOL_MAT_MAPPER
+
 protected:
 
   DECLARE_OCTAVE_ALLOCATOR
--- a/src/ov-re-mat.cc	Sun Oct 04 01:04:29 2009 -0400
+++ b/src/ov-re-mat.cc	Mon Oct 05 00:11:07 2009 -0400
@@ -315,7 +315,7 @@
 	}
     }
 
-  retval = octave_value (chm, true, type);
+  retval = octave_value (chm, type);
 
   return retval;
 }
--- a/src/ov-re-sparse.cc	Sun Oct 04 01:04:29 2009 -0400
+++ b/src/ov-re-sparse.cc	Mon Oct 05 00:11:07 2009 -0400
@@ -239,7 +239,8 @@
 		    static_cast<char> (ival);
 		}
 	  }
-      retval = octave_value (chm, true, type);
+
+      retval = octave_value (chm, type);
     }
 
   return retval;
--- a/src/ov-str-mat.cc	Sun Oct 04 01:04:29 2009 -0400
+++ b/src/ov-str-mat.cc	Mon Oct 05 00:11:07 2009 -0400
@@ -97,7 +97,7 @@
   switch (len)
     {
     case 0:
-      retval = octave_value (matrix, true, type);
+      retval = octave_value (matrix, type);
       break;
 
     case 1:
@@ -106,7 +106,7 @@
 
 	if (! error_state)
 	  retval = octave_value (charNDArray (matrix.index (i, resize_ok)),
-				 true, type);
+				 type);
       }
       break;
 
@@ -117,7 +117,7 @@
 
 	if (! error_state)
 	  retval = octave_value (charNDArray (matrix.index (i, j, resize_ok)),
-				 true, type);
+				 type);
       }
       break;
 
@@ -130,7 +130,7 @@
 
 	if (! error_state)
 	  retval = octave_value (charNDArray (matrix.index (idx_vec, resize_ok)),
-				 true, type);
+				 type);
       }
       break;
     }
@@ -143,10 +143,10 @@
 {
   charNDArray retval (matrix);
   if (fill)
-    retval.resize (dv, charNDArray::resize_fill_value());
+    retval.resize (dv, charNDArray::resize_fill_value ());
   else
     retval.resize (dv);
-  return octave_value (retval, true);
+  return octave_value (retval, is_sq_string () ? '\'' : '"');
 }
 
 #define CHAR_MATRIX_CONV(T, INIT, TNAME, FCN) \
@@ -750,46 +750,6 @@
 
 #endif
 
-#define MACRO_WRAPPER(FCN, CTYPE_FCN) \
-  static int x ## FCN (int c) { return CTYPE_FCN (c); }
-
-#define STRING_MAPPER(FCN, AMAP, CTYPE_FCN) \
-  MACRO_WRAPPER (FCN, CTYPE_FCN) \
- \
-  octave_value \
-  octave_char_matrix_str::FCN (void) const \
-  { \
-    static charNDArray::mapper smap = x ## FCN; \
-    return matrix.AMAP (smap);  \
-  }
-
-#define TOSTRING_MAPPER(FCN, AMAP, CTYPE_FCN) \
-  MACRO_WRAPPER (FCN, CTYPE_FCN) \
- \
-  octave_value \
-  octave_char_matrix_str::FCN (void) const \
-  { \
-    static charNDArray::mapper smap = x ## FCN; \
-    return octave_value (matrix.AMAP (smap), true, \
-			 is_sq_string () ? '\'' : '"'); \
-  }
-
-STRING_MAPPER (xisalnum, bmap, isalnum)
-STRING_MAPPER (xisalpha, bmap, isalpha)
-STRING_MAPPER (xisascii, bmap, isascii)
-STRING_MAPPER (xiscntrl, bmap, iscntrl)
-STRING_MAPPER (xisdigit, bmap, isdigit)
-STRING_MAPPER (xisgraph, bmap, isgraph)
-STRING_MAPPER (xislower, bmap, islower)
-STRING_MAPPER (xisprint, bmap, isprint)
-STRING_MAPPER (xispunct, bmap, ispunct)
-STRING_MAPPER (xisspace, bmap, isspace)
-STRING_MAPPER (xisupper, bmap, isupper)
-STRING_MAPPER (xisxdigit, bmap, isxdigit)
-STRING_MAPPER (xtoascii, dmap, toascii)
-TOSTRING_MAPPER (xtolower, smap, tolower)
-TOSTRING_MAPPER (xtoupper, smap, toupper)
-
 /*
 ;;; Local Variables: ***
 ;;; mode: C++ ***
--- a/src/ov-str-mat.h	Sun Oct 04 01:04:29 2009 -0400
+++ b/src/ov-str-mat.h	Mon Oct 05 00:11:07 2009 -0400
@@ -35,8 +35,8 @@
 #include "error.h"
 #include "oct-stream.h"
 #include "ov.h"
+#include "ov-ch-mat.h"
 #include "ov-re-mat.h"
-#include "ov-ch-mat.h"
 #include "ov-typeinfo.h"
 
 class Octave_map;
@@ -92,18 +92,18 @@
     { return do_index_op_internal (idx, resize_ok); }
 
   octave_value squeeze (void) const
-    { return octave_value (charNDArray (matrix.squeeze ()), true); }
+    { return octave_value (charNDArray (matrix.squeeze ())); }
 
   octave_value reshape (const dim_vector& new_dims) const
-    { return octave_value (charNDArray (matrix.reshape (new_dims)), true); }
+    { return octave_value (charNDArray (matrix.reshape (new_dims))); }
 
   octave_value permute (const Array<int>& vec, bool inv = false) const
-    { return octave_value (charNDArray (matrix.permute (vec, inv)), true); }
+    { return octave_value (charNDArray (matrix.permute (vec, inv))); }
 
   octave_value resize (const dim_vector& dv, bool fill = false) const;
 
   octave_value diag (octave_idx_type k = 0) const
-    { return octave_value (matrix.diag (k), true); }
+    { return octave_value (matrix.diag (k)); }
 
   bool is_string (void) const { return true; }
 
@@ -130,11 +130,11 @@
   std::string string_value (bool force = false) const;
 
   octave_value sort (octave_idx_type dim = 0, sortmode mode = ASCENDING) const
-    { return octave_value (matrix.sort (dim, mode), true); }
+    { return octave_value (matrix.sort (dim, mode)); }
 
   octave_value sort (Array<octave_idx_type> &sidx, octave_idx_type dim = 0,
 		     sortmode mode = ASCENDING) const
-    { return octave_value (matrix.sort (sidx, dim, mode), true); }
+    { return octave_value (matrix.sort (sidx, dim, mode)); }
 
   bool print_as_scalar (void) const { return (rows () <= 1); }
 
@@ -160,56 +160,6 @@
 	     oct_mach_info::float_format flt_fmt) const
     { return os.write (matrix, block_size, output_type, skip, flt_fmt); }
 
-  octave_value xisalnum (void) const;
-  octave_value xisalpha (void) const;
-  octave_value xisascii (void) const;
-  octave_value xiscntrl (void) const;
-  octave_value xisdigit (void) const;
-  octave_value xisgraph (void) const;
-  octave_value xislower (void) const;
-  octave_value xisprint (void) const;
-  octave_value xispunct (void) const;
-  octave_value xisspace (void) const;
-  octave_value xisupper (void) const;
-  octave_value xisxdigit (void) const;
-  octave_value xtoascii (void) const;
-  octave_value xtolower (void) const;
-  octave_value xtoupper (void) const;
-
-#define MAT_MAPPER(MAP) \
-  octave_value MAP (void) const \
-    { \
-      octave_matrix m (array_value (true)); \
-      return m.MAP (); \
-    }
-
-  MAT_MAPPER (abs)
-  MAT_MAPPER (angle)
-  MAT_MAPPER (arg)
-  MAT_MAPPER (ceil)
-  MAT_MAPPER (conj)
-  MAT_MAPPER (fix)
-  MAT_MAPPER (floor)
-  MAT_MAPPER (imag)
-  MAT_MAPPER (real)
-  MAT_MAPPER (round)
-  MAT_MAPPER (signum)
-
-#undef MAT_MAPPER
-
-#define BOOL_MAT_MAPPER(MAP, VAL)	\
-  octave_value MAP (void) const \
-    { \
-      return boolNDArray (matrix.dims (), VAL); \
-    }
-
-  BOOL_MAT_MAPPER (finite, true)
-  BOOL_MAT_MAPPER (isinf, false)
-  BOOL_MAT_MAPPER (isna, false)
-  BOOL_MAT_MAPPER (isnan, false)
-
-#undef BOOL_MAT_MAPPER
-
 protected:
 
   octave_value do_index_op_internal (const octave_value_list& idx,
@@ -262,23 +212,23 @@
   octave_base_value *empty_clone (void) const { return new octave_char_matrix_sq_str (); }
 
   octave_value squeeze (void) const
-    { return octave_value (charNDArray (matrix.squeeze ()), true, '\''); }
+    { return octave_value (charNDArray (matrix.squeeze ()), '\''); }
 
   octave_value reshape (const dim_vector& new_dims) const
-    { return octave_value (charNDArray (matrix.reshape (new_dims)), true, '\''); }
+    { return octave_value (charNDArray (matrix.reshape (new_dims)), '\''); }
 
   octave_value permute (const Array<int>& vec, bool inv = false) const
-    { return octave_value (charNDArray (matrix.permute (vec, inv)), true, '\''); }
+    { return octave_value (charNDArray (matrix.permute (vec, inv)), '\''); }
 
   octave_value resize (const dim_vector& dv, bool = false) const
     {
       charNDArray retval (matrix);
       retval.resize (dv);
-      return octave_value (retval, true, '\'');
+      return octave_value (retval, '\'');
     }
 
   octave_value diag (octave_idx_type k = 0) const
-    { return octave_value (matrix.diag (k), true, '\''); }
+    { return octave_value (matrix.diag (k), '\''); }
 
   bool is_sq_string (void) const { return true; }
 
@@ -288,11 +238,11 @@
 
 
   octave_value sort (octave_idx_type dim = 0, sortmode mode = ASCENDING) const
-    { return octave_value (matrix.sort (dim, mode), true, '\''); }
+    { return octave_value (matrix.sort (dim, mode), '\''); }
 
   octave_value sort (Array<octave_idx_type> &sidx, octave_idx_type dim = 0,
 		     sortmode mode = ASCENDING) const
-    { return octave_value (matrix.sort (sidx, dim, mode), true, '\''); }
+    { return octave_value (matrix.sort (sidx, dim, mode), '\''); }
 
 private:
 
--- a/src/ov.cc	Sun Oct 04 01:04:29 2009 -0400
+++ b/src/ov.cc	Mon Oct 05 00:11:07 2009 -0400
@@ -810,32 +810,50 @@
   maybe_mutate ();
 }
 
-octave_value::octave_value (const charMatrix& chm, bool is_str, char type)
-  : rep (is_str
-	 ? (type == '"'
-	    ? new octave_char_matrix_dq_str (chm)
-	    : new octave_char_matrix_sq_str (chm))
-	 : new octave_char_matrix (chm))
+octave_value::octave_value (const charMatrix& chm, char type)
+  : rep (type == '"'
+	 ? new octave_char_matrix_dq_str (chm)
+	 : new octave_char_matrix_sq_str (chm))
+{
+  maybe_mutate ();
+}
+
+octave_value::octave_value (const charNDArray& chm, char type)
+  : rep (type == '"'
+	 ? new octave_char_matrix_dq_str (chm)
+	 : new octave_char_matrix_sq_str (chm))
 {
   maybe_mutate ();
 }
 
-octave_value::octave_value (const charNDArray& chm, bool is_str, char type)
-  : rep (is_str
-	 ? (type == '"'
-	    ? new octave_char_matrix_dq_str (chm)
-	    : new octave_char_matrix_sq_str (chm))
-	 : new octave_char_matrix (chm))
+octave_value::octave_value (const ArrayN<char>& chm, char type)
+  : rep (type == '"'
+	 ? new octave_char_matrix_dq_str (chm)
+	 : new octave_char_matrix_sq_str (chm))
 {
   maybe_mutate ();
 }
 
-octave_value::octave_value (const ArrayN<char>& chm, bool is_str, char type)
-  : rep (is_str
-	 ? (type == '"'
-	    ? new octave_char_matrix_dq_str (chm)
-	    : new octave_char_matrix_sq_str (chm))
-	 : new octave_char_matrix (chm))
+octave_value::octave_value (const charMatrix& chm, bool, char type)
+  : rep (type == '"'
+	 ? new octave_char_matrix_dq_str (chm)
+	 : new octave_char_matrix_sq_str (chm))
+{
+  maybe_mutate ();
+}
+
+octave_value::octave_value (const charNDArray& chm, bool, char type)
+  : rep (type == '"'
+	 ? new octave_char_matrix_dq_str (chm)
+	 : new octave_char_matrix_sq_str (chm))
+{
+  maybe_mutate ();
+}
+
+octave_value::octave_value (const ArrayN<char>& chm, bool, char type)
+  : rep (type == '"'
+	 ? new octave_char_matrix_dq_str (chm)
+	 : new octave_char_matrix_sq_str (chm))
 {
   maybe_mutate ();
 }
--- a/src/ov.h	Sun Oct 04 01:04:29 2009 -0400
+++ b/src/ov.h	Mon Oct 05 00:11:07 2009 -0400
@@ -223,16 +223,19 @@
   octave_value (const boolMatrix& bm, const MatrixType& t = MatrixType());
   octave_value (const boolNDArray& bnda);
   octave_value (const ArrayN<bool>& bnda);
-  octave_value (char c, char type = '"');
-  octave_value (const char *s, char type = '"');
-  octave_value (const std::string& s, char type = '"');
-  octave_value (const string_vector& s, char type = '"');
-  octave_value (const charMatrix& chm, bool is_string = false,
-		char type = '"');
-  octave_value (const charNDArray& chnda, bool is_string = false,
-		char type = '"');
-  octave_value (const ArrayN<char>& chnda, bool is_string = false,
-		char type = '"');
+  octave_value (char c, char type = '\'');
+  octave_value (const char *s, char type = '\'');
+  octave_value (const std::string& s, char type = '\'');
+  octave_value (const string_vector& s, char type = '\'');
+  octave_value (const charMatrix& chm, 	char type = '\'');
+  octave_value (const charNDArray& chnda, char type = '\'');
+  octave_value (const ArrayN<char>& chnda, char type = '\'');
+  octave_value (const charMatrix& chm, bool is_string,
+		char type = '\'') GCC_ATTR_DEPRECATED;
+  octave_value (const charNDArray& chnda, bool is_string,
+		char type = '\'') GCC_ATTR_DEPRECATED;
+  octave_value (const ArrayN<char>& chnda, bool is_string,
+		char type = '\'') GCC_ATTR_DEPRECATED;
   octave_value (const SparseMatrix& m, const MatrixType& t = MatrixType ());
   octave_value (const Sparse<double>& m, const MatrixType& t = MatrixType ());
   octave_value (const SparseComplexMatrix& m, 
@@ -946,8 +949,8 @@
   // it, and we should convert it if possible.
 
   octave_value convert_to_str (bool pad = false, bool force = false,
-			       char type = '"') const
-  { return rep->convert_to_str (pad, force, type); }
+			       char type = '\'') const
+    { return rep->convert_to_str (pad, force, type); }
 
   octave_value
   convert_to_str_internal (bool pad, bool force, char type) const
--- a/src/pt-mat.cc	Sun Oct 04 01:04:29 2009 -0400
+++ b/src/pt-mat.cc	Mon Oct 05 00:11:07 2009 -0400
@@ -920,7 +920,7 @@
 
 	  SINGLE_TYPE_CONCAT (charNDArray, char_array_value);
 
-	  retval = octave_value (result, true, type);
+	  retval = octave_value (result, type);
 	}
       else if (result_type == "logical")
 	{