# HG changeset patch # User jwe # Date 1056459612 0 # Node ID 689f730954b3f4a0013a205da94bb0732e44542e # Parent dd7af4fa19421cbb2451dc804f9e305f004c79ed [project @ 2003-06-24 13:00:12 by jwe] diff -r dd7af4fa1942 -r 689f730954b3 src/ChangeLog --- a/src/ChangeLog Mon Jun 23 17:52:36 2003 +0000 +++ b/src/ChangeLog Tue Jun 24 13:00:12 2003 +0000 @@ -1,3 +1,9 @@ +2003-06-24 John W. Eaton + + * ov-base.cc (octave_base_value::subsasgn): Also allow type + conversion for empty numeric objects with more than one index. + * ov-base-mat.cc (octave_base_matrix::subsasgn): Likewise. + 2003-06-23 John W. Eaton * variables.cc (do_who): New arg, return_list. If return_list is diff -r dd7af4fa1942 -r 689f730954b3 src/ov-base-mat.cc --- a/src/ov-base-mat.cc Mon Jun 23 17:52:36 2003 +0000 +++ b/src/ov-base-mat.cc Tue Jun 24 13:00:12 2003 +0000 @@ -79,6 +79,17 @@ { if (type.length () == 1) retval = numeric_assign (type, idx, rhs); + else if (is_empty ()) + { + // Allow conversion of empty matrix to some other type in + // cases like + // + // x = []; x(i).f = rhs + + octave_value tmp = octave_value::empty_conv (type, rhs); + + retval = tmp.subsasgn (type, idx, rhs); + } else { std::string nm = type_name (); diff -r dd7af4fa1942 -r 689f730954b3 src/ov-base.cc --- a/src/ov-base.cc Mon Jun 23 17:52:36 2003 +0000 +++ b/src/ov-base.cc Tue Jun 24 13:00:12 2003 +0000 @@ -114,6 +114,17 @@ { if (type.length () == 1) retval = numeric_assign (type, idx, rhs); + else if (is_empty ()) + { + // Allow conversion of empty matrix to some other + // type in cases like + // + // x = []; x(i).f = rhs + + octave_value tmp = octave_value::empty_conv (type, rhs); + + retval = tmp.subsasgn (type, idx, rhs); + } else { std::string nm = type_name ();