changeset 2371:dd29ab8af9e7

[project @ 1996-10-12 00:09:55 by jwe]
author jwe
date Sat, 12 Oct 1996 00:09:57 +0000
parents a45c7d64b5e3
children b21b42c25350
files src/help.cc src/input.cc src/load-save.cc src/pt-mat.cc src/pt-misc.cc src/pt-plot.cc
diffstat 6 files changed, 25 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/src/help.cc	Fri Oct 11 23:55:30 1996 +0000
+++ b/src/help.cc	Sat Oct 12 00:09:57 1996 +0000
@@ -788,7 +788,7 @@
 
 		  assert (defn && defn->is_constant ());
 
-		  octave_value *tmp = (octave_value *) defn;
+		  tree_constant *tmp = (tree_constant *) defn;
 
 		  int var_ok = 1;
 		  if (tmp && tmp->is_map ())
--- a/src/input.cc	Fri Oct 11 23:55:30 1996 +0000
+++ b/src/input.cc	Sat Oct 12 00:09:57 1996 +0000
@@ -679,9 +679,9 @@
     {
       tree_fvc *tmp_fvc = sr->def ();
 
-      octave_value *def = 0;
+      tree_constant *def = 0;
       if (tmp_fvc->is_constant ())
-	def = (octave_value *) tmp_fvc;
+	def = (tree_constant *) tmp_fvc;
 
       if (def && def->is_map ())
 	{
@@ -773,9 +773,9 @@
     {
       tree_fvc *tmp_fvc = sr->def ();
 
-      octave_value *def = 0;
+      tree_constant *def = 0;
       if (tmp_fvc->is_constant ())
-	def = (octave_value *) tmp_fvc;
+	def = (tree_constant *) tmp_fvc;
 
       if (def && def->is_map ())
 	{
@@ -1082,7 +1082,7 @@
 	  if (retval.is_defined ())
 	    {
 	      if (debug)
-		retval.eval (1);
+		retval.print ();
 	    }
 	  else
 	    retval = Matrix ();
--- a/src/load-save.cc	Fri Oct 11 23:55:30 1996 +0000
+++ b/src/load-save.cc	Sat Oct 12 00:09:57 1996 +0000
@@ -49,10 +49,12 @@
 #include "oct-obj.h"
 #include "pager.h"
 #include "pt-exp.h"
+#include "pt-fvc.h"
 #include "symtab.h"
 #include "sysdep.h"
 #include "unwind-prot.h"
 #include "utils.h"
+#include "variables.h"
 
 // The default output format.  May be one of "binary", "text", or
 // "mat-binary".
@@ -85,7 +87,7 @@
 // Assumes TC is defined.
 
 static void
-install_loaded_variable (int force, char *name, const octave_value& tc,
+install_loaded_variable (int force, char *name, const octave_value& val,
 			 int global, char *doc)
 {
   // Is there already a symbol by this name?  If so, what is it?
@@ -203,8 +205,7 @@
 
   if (sr)
     {
-      octave_value *tmp_tc = new octave_value (tc);
-      sr->define (tmp_tc);
+      sr->define (val);
       if (doc)
 	sr->document (doc);
       return;
@@ -1364,7 +1365,8 @@
 			      << "type               rows   cols   name\n"
 			      << "====               ====   ====   ====\n";
 
-			  output_buf.form ("%-16s", tc.type_as_string ());
+			  string type = tc.type_name ();
+			  output_buf.form ("%-16s", type.c_str ());
 			  output_buf.form ("%7d", tc.rows ());
 			  output_buf.form ("%7d", tc.columns ());
 			  output_buf << "   ";
@@ -2083,7 +2085,8 @@
   string name = sr->name ();
   string help = sr->help ();
   int global = sr->is_linked_to_global ();
-  octave_value tc = *((octave_value *) sr->def ());
+  tree_fvc *tmp = sr->def ();
+  octave_value tc = tmp->eval (0);
 
   if (tc.is_undefined ())
     return;
--- a/src/pt-mat.cc	Fri Oct 11 23:55:30 1996 +0000
+++ b/src/pt-mat.cc	Sat Oct 12 00:09:57 1996 +0000
@@ -34,7 +34,6 @@
 #include "defun.h"
 #include "error.h"
 #include "oct-obj.h"
-#include "pt-const.h"
 #include "pt-exp.h"
 #include "pt-fvc.h"
 #include "pt-mat.h"
@@ -42,6 +41,8 @@
 #include "pt-mvr.h"
 #include "pt-walk.h"
 #include "utils.h"
+#include "ov.h"
+#include "variables.h"
 
 // Are empty elements in a matrix list ok?  For example, is the empty
 // matrix in an expression like `[[], 1]' ok?  A positive value means
--- a/src/pt-misc.cc	Fri Oct 11 23:55:30 1996 +0000
+++ b/src/pt-misc.cc	Sat Oct 12 00:09:57 1996 +0000
@@ -40,7 +40,6 @@
 #include "pager.h"
 #include "toplev.h"
 #include "pt-cmd.h"
-#include "pt-const.h"
 #include "pt-exp.h"
 #include "pt-fcn.h"
 #include "pt-fvc.h"
@@ -48,6 +47,7 @@
 #include "pt-mvr.h"
 #include "pt-walk.h"
 #include "pt-pr-code.h"
+#include "ov.h"
 #include "variables.h"
 
 // Nonzero means we're breaking out of a loop or function body.
@@ -306,7 +306,10 @@
     {
       tree_identifier *elt = this->operator () (p);
       if (! elt->is_defined ())
-	elt->assign (val);
+	{
+	  octave_variable_reference tmp (elt);
+	  tmp.assign (val);
+	}
     }
 }
 
@@ -326,7 +329,7 @@
     {
       tree_identifier *elt = this->operator () (p);
 
-      octave_value *tmp = 0;
+      tree_constant *tmp = 0;
 
       if (i < nargin)
 	{
@@ -335,7 +338,7 @@
 	      ::error ("invalid use of colon in function argument list");
 	      return;
 	    }
-	  tmp = new octave_value (args(i));
+	  tmp = new tree_constant (args (i));
 	}
 
       elt->define (tmp);
--- a/src/pt-plot.cc	Fri Oct 11 23:55:30 1996 +0000
+++ b/src/pt-plot.cc	Sat Oct 12 00:09:57 1996 +0000
@@ -61,6 +61,7 @@
 #include "sighandlers.h"
 #include "sysdep.h"
 #include "utils.h"
+#include "variables.h"
 
 // If TRUE, a replot command is issued automatically each time a plot
 // changes in some way.
@@ -627,8 +628,7 @@
       args(1) = val;
       args(0) = octave_value::magic_colon_t;
 
-      octave_value_list tmp = data.eval (0, 1, args);
-      retval = tmp(0);
+      retval = data.index (args);
 
       if (error_state)
 	return octave_value ();