diff src/variables.cc @ 5780:cbf717bf8150

[project @ 2006-04-27 20:02:30 by jwe]
author jwe
date Thu, 27 Apr 2006 20:03:48 +0000
parents ace8d8d26933
children faafc2d98b8d
line wrap: on
line diff
--- a/src/variables.cc	Thu Apr 27 19:30:14 2006 +0000
+++ b/src/variables.cc	Thu Apr 27 20:03:48 2006 +0000
@@ -805,10 +805,6 @@
 	    {
 	      retval = 101;
 	    }
-	  else if (var_ok && sr->is_builtin_constant ())
-	    {
-	      retval = 102;
-	    }
 	}
 
       if (! retval
@@ -913,7 +909,7 @@
 appending @samp{.m}) is a function file in Octave's LOADPATH, 3 if the\n\
 name is a @samp{.oct} file in Octave's LOADPATH, 5 if the name is a\n\
 built-in function, 7 if the name is a directory, 101 if the name is\n\
-a built-in variable, 102 if the name is a built-in constant, or 103\n\
+a built-in variable, or 103\n\
 if the name is a function not associated with a file (entered on\n\
 the command line).\n\
 \n\
@@ -1365,7 +1361,7 @@
 // definition of the builtin variable of the same name.
 
 // Make the definition of the symbol record sr be the same as the
-// definition of the builtin variable, constant, or function, or user
+// definition of the builtin variable or function, or user
 // function of the same name, provided that the name has not been used
 // as a formal parameter.
 
@@ -1388,7 +1384,6 @@
 
   if (tmp_sym
       && (tmp_sym->is_builtin_variable ()
-	  || tmp_sym->is_builtin_constant ()
 	  || tmp_sym->is_function ())
       && ! tmp_sym->is_formal_parameter ())
     sr->alias (tmp_sym);
@@ -1538,7 +1533,6 @@
 
       dim_vector dv (0, 0);
 
-      Array<symbol_record *> s1 (dv);
       Array<symbol_record *> s2 (dv);
       Array<symbol_record *> s3 (dv);
       Array<symbol_record *> s4 (dv);
@@ -1548,9 +1542,6 @@
 
       if (show_builtins)
 	{
-	  s1 = fbi_sym_tab->symbol_list (pats, symbol_record::BUILTIN_CONSTANT,
-					 SYMTAB_ALL_SCOPES);
-
 	  s2 = fbi_sym_tab->symbol_list (pats, symbol_record::BUILTIN_VARIABLE,
 					 SYMTAB_ALL_SCOPES);
 
@@ -1576,7 +1567,6 @@
 					  SYMTAB_GLOBAL_SCOPE);
 	}
 
-      octave_idx_type s1_len = s1.length ();
       octave_idx_type s2_len = s2.length ();
       octave_idx_type s3_len = s3.length ();
       octave_idx_type s4_len = s4.length ();
@@ -1585,14 +1575,12 @@
       octave_idx_type s7_len = s7.length ();
 
       octave_idx_type symbols_len
-	= s1_len + s2_len + s3_len + s4_len + s5_len + s6_len + s7_len;
+	= s2_len + s3_len + s4_len + s5_len + s6_len + s7_len;
 
       Array<symbol_record *> symbols (dim_vector (symbols_len, 1));
 
       octave_idx_type k = 0;
 
-      symbols.insert (s1, k, 0);
-      k += s1_len;
       symbols.insert (s2, k, 0);
       k += s2_len;
       symbols.insert (s3, k, 0);
@@ -1678,10 +1666,6 @@
       if (show_builtins)
 	{
 	  pad_after += fbi_sym_tab->maybe_list
-	    ("*** built-in constants:", pats, octave_stdout,
-	     show_verbose, symbol_record::BUILTIN_CONSTANT, SYMTAB_ALL_SCOPES);
-
-	  pad_after += fbi_sym_tab->maybe_list
 	    ("*** built-in variables:", pats, octave_stdout,
 	     show_verbose, symbol_record::BUILTIN_VARIABLE, SYMTAB_ALL_SCOPES);
 
@@ -1829,32 +1813,6 @@
     }
 }
 
-// Give a global constant a definition.  This will insert the symbol
-// in the global table if necessary.
-
-// How is this different than install_builtin_constant?  Are both
-// functions needed?
-
-void
-bind_builtin_constant (const std::string& name, const octave_value& val,
-		       bool protect, bool eternal, const std::string& help)
-{
-  symbol_record *sym_rec = fbi_sym_tab->lookup (name, true);
-  sym_rec->unprotect ();
-
-  std::string tmp_help = help.empty () ? sym_rec->help () : help;
-
-  sym_rec->define_builtin_const (val);
-
-  sym_rec->document (tmp_help);
-
-  if (protect)
-    sym_rec->protect ();
-
-  if (eternal)
-    sym_rec->make_eternal ();
-}
-
 // Give a global variable a definition.  This will insert the symbol
 // in the global table if necessary.