# HG changeset patch # User jwe # Date 1144868065 0 # Node ID 958e365b875e2924b8367141e8e63bb1e2aa6ae5 # Parent 493849caf7e96178242af7194d6dcad6350f70e8 [project @ 2006-04-12 18:54:25 by jwe] diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,9 +1,17 @@ 2006-04-12 John W. Eaton + * ov-struct.cc (octave_struct::load_ascii): Pass loop counter, not + count, to read_ascii. + * ov-list.cc (octave_list::load_ascii): Likewise. + + * ov-list.cc (octave_list::do_index_op): Allow index to extract + multiple items. Result is always a list. + * ov-struct.cc (struct_levels_to_print): Move here from ov.cc. (Vstruct-levels_to_print): Likewise. Now static. (symbols_of_ov_struct): New function. Move DEFVAR for struct_levels_to_print here from symbols_of_ov in ov.cc. + * ov.h (Vstruct-levels_to_print): Delete decl. * gripes.cc (warn_divide_by_zero): Move here from ov.cc. diff --git a/src/ov-list.cc b/src/ov-list.cc --- a/src/ov-list.cc +++ b/src/ov-list.cc @@ -133,10 +133,21 @@ { idx_vector i = idx (0).index_vector (); - retval = octave_list (data.index (i, resize_ok)); + Cell tcell = data.index (i, resize_ok); + + octave_value_list result; + + octave_idx_type n = tcell.numel (); + + result.resize (n); + + for (octave_idx_type i = 0; i < n; i++) + result(i) = tcell(i); + + retval = result; } else - error ("lists may only be indexed by a single scalar"); + error ("only one index allowed for lists"); return retval; } @@ -571,7 +582,7 @@ // recurse to read list elements std::string nm - = read_ascii_data (is, std::string (), dummy, t2, count); + = read_ascii_data (is, std::string (), dummy, t2, j); if (!is) break;