# HG changeset patch # User jwe # Date 1116865196 0 # Node ID 33adb987c0330c24e57f9abf958329fc07c52cc3 # Parent 17e40a1331b01d80cb566cac393fb6ba5bce23b2 [project @ 2005-05-23 16:19:56 by jwe] diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,18 @@ +2005-05-23 John W. Eaton + + * debug.cc (Fdbwhere, get_user_function): Look at + curr_caller_function, not curr_function, since function is now set + inside mapper, built-in (and thereford dld) functions too. + 2005-05-21 John W. Eaton + * pr-output.cc, pr-output.h (Vprint_empty_dimensions): Now extern. + * ov-cell.cc (octave_cell::print_raw): Conditionally print + dimensions of empty 2-d cell arrays. + + * DLD-FUNCTIONS/sort.cc (mx_sort, mx_sort_indexed): Return empty + values for empty args. + * lex.l (handle_string): If single-quote string, \ and . have no special meaning. diff --git a/src/DLD-FUNCTIONS/sort.cc b/src/DLD-FUNCTIONS/sort.cc --- a/src/DLD-FUNCTIONS/sort.cc +++ b/src/DLD-FUNCTIONS/sort.cc @@ -87,7 +87,7 @@ octave_value retval; if (m.length () < 1) - return retval; + return ArrayN (); dim_vector dv = m.dims (); octave_idx_type ns = dv(dim); @@ -148,7 +148,11 @@ octave_value_list retval; if (m.length () < 1) - return retval; + { + retval(1) = NDArray (); + retval(0) = ArrayN (); + return retval; + } dim_vector dv = m.dims (); octave_idx_type ns = dv(dim); @@ -296,7 +300,7 @@ octave_value retval; if (m.length () < 1) - return retval; + return ArrayN (); dim_vector dv = m.dims (); octave_idx_type ns = dv(dim); @@ -433,7 +437,11 @@ octave_value_list retval; if (m.length () < 1) - return retval; + { + retval(1) = ArrayN (); + retval(0) = NDArray (); + return retval; + } dim_vector dv = m.dims (); octave_idx_type ns = dv(dim); diff --git a/src/debug.cc b/src/debug.cc --- a/src/debug.cc +++ b/src/debug.cc @@ -74,8 +74,8 @@ } } } - else if (curr_function && curr_function->is_user_function ()) - dbg_fcn = dynamic_cast (curr_function); + else if (curr_caller_function && curr_caller_function->is_user_function ()) + dbg_fcn = dynamic_cast (curr_caller_function); return dbg_fcn; } @@ -285,8 +285,8 @@ octave_user_function *dbg_fcn = 0; - if (curr_function && curr_function->is_user_function ()) - dbg_fcn = dynamic_cast (curr_function); + if (curr_caller_function && curr_caller_function->is_user_function ()) + dbg_fcn = dynamic_cast (curr_caller_function); if (dbg_fcn) { diff --git a/src/ov-cell.cc b/src/ov-cell.cc --- a/src/ov-cell.cc +++ b/src/ov-cell.cc @@ -28,6 +28,8 @@ #include #include +#include "Array-util.h" +#include "byte-swap.h" #include "lo-sstream.h" #include "lo-utils.h" #include "quit.h" @@ -42,9 +44,9 @@ #include "ov-base-mat.cc" #include "ov-re-mat.h" #include "ov-scalar.h" -#include "Array-util.h" +#include "pr-output.h" +#include "ov-scalar.h" -#include "byte-swap.h" #include "ls-oct-ascii.h" #include "ls-oct-binary.h" #include "ls-hdf5.h" @@ -402,7 +404,7 @@ else { os << "{}"; - if (nr > 0 || nc > 0) + if (Vprint_empty_dimensions) os << "(" << nr << "x" << nc << ")"; os << "\n"; } diff --git a/src/pr-output.cc b/src/pr-output.cc --- a/src/pr-output.cc +++ b/src/pr-output.cc @@ -70,9 +70,9 @@ // routines. static int Voutput_precision; -// TRUE means that the dimensions of empty matrices should be printed +// TRUE means that the dimensions of empty objects should be printed // like this: x = [](2x0). -static bool Vprint_empty_dimensions; +bool Vprint_empty_dimensions; // TRUE means that the rows of big matrices should be split into // smaller slices that fit on the screen. diff --git a/src/pr-output.h b/src/pr-output.h --- a/src/pr-output.h +++ b/src/pr-output.h @@ -125,6 +125,10 @@ int extra_indent = 0, bool pr_as_string = false); +// TRUE means that the dimensions of empty objects should be printed +// like this: x = [](2x0). +extern bool Vprint_empty_dimensions; + #endif /*