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	Sun Nov 06 15:13:37 2011 -0800
+++ b/scripts/general/display.m	Thu Oct 27 09:59:26 2011 -0700
@@ -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