Mercurial > hg > octave-avbm
changeset 13835:fc9f34e17486
display.m: Extend display to work on builtin classes (Bug #34637)
* display.m: Extend display to work on builtin classes.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Thu, 27 Oct 2011 09:59:26 -0700 |
parents | 227130df89eb |
children | 519390f1b67f |
files | scripts/general/display.m |
diffstat | 1 files changed, 12 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/general/display.m +++ b/scripts/general/display.m @@ -33,9 +33,18 @@ ## @end deftypefn function idx = display (a) - if (nargin == 1) - error ("display: not defined for class \"%s\"", class(a)); - else + + if (nargin != 1) print_usage (); endif + + ## Only reason we got here is that there was no overloaded display() + ## function for object a. This may mean it is a built-in. + str = disp (a); + if (isempty (strfind (str, "<class "))) + disp (str); + else + error ('display: not defined for class "%s"', class (a)); + endif + endfunction