changeset 549:75a371805554

[project @ 1994-07-22 19:44:41 by jwe]
author jwe
date Fri, 22 Jul 1994 19:45:00 +0000
parents 18007cc05a02
children 95ee5e330179
files src/dirfns.cc src/octave.cc src/sysdep.cc src/variables.cc
diffstat 4 files changed, 28 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/dirfns.cc
+++ b/src/dirfns.cc
@@ -411,8 +411,6 @@
   return retval;
 }
 
-DEFALIAS (dir, ls);
-
 /*
  * Get a directory listing.
  */
@@ -453,6 +451,8 @@
   return retval;
 }
 
+DEFALIAS (dir, ls);
+
 DEFUN ("pwd", Fpwd, Spwd, 1, 0,
   "pwd (): print current working directory")
 {
--- a/src/octave.cc
+++ b/src/octave.cc
@@ -579,8 +579,6 @@
   return retval;
 }
 
-DEFALIAS (exit, quit);
-
 DEFUN ("flops", Fflops, Sflops, 2, 1,
   "flops (): count floating point operations")
 {
@@ -603,6 +601,8 @@
   return retval;
 }
 
+DEFALIAS (exit, quit);
+
 DEFUN ("warranty", Fwarranty, Swarranty, 1, 0,
   "warranty (): describe copying conditions")
 {
--- a/src/sysdep.cc
+++ b/src/sysdep.cc
@@ -389,6 +389,8 @@
   return retval;
 }
 
+DEFALIAS (home, clc);
+
 DEFUN ("getenv", Fgetenv, Sgetenv, 2, 1,
   "getenv (STRING): get environment variable values")
 {
@@ -410,8 +412,6 @@
   return retval;
 }
 
-DEFALIAS (home, clc);
-
 DEFUN ("kbhit", Fkbhit, Skbhit, 1, 1,
   "kbhit: get a single character from the terminal")
 {
--- a/src/variables.cc
+++ b/src/variables.cc
@@ -204,6 +204,21 @@
 }
 
 void
+alias_builtin (const char *alias, const char *name)
+{
+  symbol_record *sr_name = global_sym_tab->lookup (name, 0, 0);
+  if (! sr_name)
+    panic ("can't alias to undefined name!");
+
+  symbol_record *sr_alias = global_sym_tab->lookup (alias, 1, 0);
+
+  if (sr_alias)
+    sr_alias->alias (sr_name);
+  else
+    panic_impossible ();
+}
+
+void
 bind_nargin_and_nargout (symbol_table *sym_tab, int nargin, int nargout)
 {
   tree_constant *tmp;
@@ -1399,6 +1414,13 @@
   return 0;
 }
 
+static int
+is_globally_visible (const char *name)
+{
+  symbol_record *sr = curr_sym_tab->lookup (name, 0, 0);
+  return (sr && sr->is_linked_to_global ());
+}
+
 DEFUN_TEXT ("save", Fsave, Ssave, -1, 1,
   "save file [var ...]\n\
 \n\
@@ -1406,7 +1428,6 @@
 {
   Octave_object retval;
 
-#if 0
   DEFINE_ARGV("save");
 
   if (argc < 2)
@@ -1505,7 +1526,6 @@
     file.close ();
 
   DELETE_ARGV;
-#endif
 
   return retval;
 }