changeset 2875:2e45e7a3d45e

[project @ 1997-04-24 08:56:20 by jwe]
author jwe
date Thu, 24 Apr 1997 08:57:09 +0000
parents 38ca4e62120c
children b4a9f014a8ea
files src/SLList-expr.cc src/SLList-misc.cc src/SLList-plot.cc src/SLList-tm.cc src/file-io.cc src/help.cc
diffstat 6 files changed, 33 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/src/SLList-expr.cc
+++ b/src/SLList-expr.cc
@@ -29,6 +29,7 @@
 #include "SLList.h"
 #include "SLList.cc"
 
+#include "ov.h"
 #include "pt-exp.h"
 #include "pt-fvc.h"
 #include "pt-mvr.h"
--- a/src/SLList-misc.cc
+++ b/src/SLList-misc.cc
@@ -29,6 +29,7 @@
 #include "SLList.h"
 #include "SLList.cc"
 
+#include "ov.h"
 #include "pt-exp.h"
 #include "ov.h"
 #include "pt-misc.h"
--- a/src/SLList-plot.cc
+++ b/src/SLList-plot.cc
@@ -29,6 +29,7 @@
 #include "SLList.h"
 #include "SLList.cc"
 
+#include "ov.h"
 #include "pt-plot.h"
 
 template class SLNode<subplot *>;
--- a/src/SLList-tm.cc
+++ b/src/SLList-tm.cc
@@ -29,6 +29,7 @@
 #include "SLList.h"
 #include "SLList.cc"
 
+#include "ov.h"
 #include "pt-mat.h"
 
 template class SLNode<tree_matrix_row *>;
--- a/src/file-io.cc
+++ b/src/file-io.cc
@@ -525,7 +525,7 @@
 
   int nargin = args.length ();
 
-  if (nargin > 1)
+  if (nargin > 1 || (nargin > 0 && args(0).is_string ()))
     {
       octave_stream *os	= 0;
       int fmt_n = 0;
--- a/src/help.cc
+++ b/src/help.cc
@@ -836,40 +836,42 @@
 		  tree_constant *tmp = static_cast<tree_constant *> (defn);
 
 		  int var_ok = 1;
-		  if (tmp && tmp->is_map ())
+
+		  // XXX FIXME XXX -- need to handle structure
+		  // references correctly.
+
+		  if (tmp)
 		    {
-		      if (! elts.empty ())
-			{
-			  octave_value ult =
-			    tmp->lookup_map_element (elts, 0, 1);
+		      octave_value vtmp = tmp->value ();
 
-			  if (! ult.is_defined ())
-			    var_ok = 0;			    
-			}
+		      if (vtmp.is_map ())
+			error ("type: operations on structs not implemented");
 		    }
 
-		  if (nargout == 0 && ! quiet)
+		  if (! error_state)
 		    {
-		      if (var_ok)
+		      if (nargout == 0 && ! quiet)
 			{
-			  output_buf << argv[i];
-			  if (sym_rec->is_user_variable ())
-			    output_buf << " is a user-defined variable\n";
+			  if (var_ok)
+			    {
+			      output_buf << argv[i];
+			      if (sym_rec->is_user_variable ())
+				output_buf << " is a user-defined variable\n";
+			      else
+				output_buf << " is a built-in variable\n";
+			    }
 			  else
-			    output_buf << " is a built-in variable\n";
+			    {
+			      if (! elts.empty ())
+				output_buf << "type: structure `" << id
+					   << "' has no member `" << elts
+					   << "'\n";
+			      else
+				output_buf << "type: `" << id
+					   << "' has unknown type!\n";
+			    }
 			}
-		      else
-			{
-			  if (! elts.empty ())
-			    output_buf << "type: structure `" << id
-			      << "' has no member `" << elts << "'\n";
-			  else
-			    output_buf << "type: `" << id
-			      << "' has unknown type!\n";
-			}
-		    }
-		  if (! tmp->is_map ())
-		    {
+
 		      tree_print_code tpc (output_buf, "", pr_orig_txt);
 
 		      tmp->accept (tpc);