changeset 704:250fc1c93fe2

[project @ 1994-09-15 02:44:42 by jwe]
author jwe
date Thu, 15 Sep 1994 02:47:09 +0000
parents 21cc5b9b9ed6
children 1900ccfdf860
files src/pt-exp-base.cc src/variables.cc
diffstat 2 files changed, 35 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/src/pt-exp-base.cc	Thu Sep 15 02:41:12 1994 +0000
+++ b/src/pt-exp-base.cc	Thu Sep 15 02:47:09 1994 +0000
@@ -43,6 +43,7 @@
 
 #include "variables.h"
 #include "user-prefs.h"
+#include "dynamic-ld.h"
 #include "help.h"
 #include "error.h"
 #include "pager.h"
@@ -1923,8 +1924,7 @@
   mapper_fcn = m_fcn;
   is_mapper = 1;
   fcn = 0;
-  if (nm)
-    my_name = strsave (nm);
+  my_name = nm ? strsave (nm) : 0;
 }
 
 tree_builtin::tree_builtin (int i_max, int o_max, Octave_builtin_fcn g_fcn,
@@ -1934,8 +1934,7 @@
   nargout_max = o_max;
   is_mapper = 0;
   fcn = g_fcn;
-  if (nm)
-    my_name = strsave (nm);
+  my_name = nm ? strsave (nm) : 0;
 }
 
 tree_constant
@@ -1948,14 +1947,23 @@
 
   if (fcn)
     {
+    eval_fcn:
+
       Octave_object args;
       args(0) = tree_constant (my_name);
       Octave_object tmp = (*fcn) (args, 1);
       if (tmp.length () > 0)
 	retval = tmp(0);
     }
-  else // Assume mapper function
-    ::error ("%s: argument expected", my_name);
+  else
+    {
+      fcn = load_octave_builtin (my_name);
+
+      if (fcn)
+	goto eval_fcn;
+      else
+	error ("unable to load builtin function %s", my_name);
+    }
 
   return retval;
 }
@@ -1972,6 +1980,8 @@
 
   if (fcn)
     {
+    eval_fcn:
+
       if (any_arg_is_magic_colon (args))
 	::error ("invalid use of colon in function argument list");
       else
@@ -1989,7 +1999,14 @@
 	}	
     }
   else
-    panic_impossible ();
+    {
+      fcn = load_octave_builtin (my_name);
+
+      if (fcn)
+	goto eval_fcn;
+      else
+	error ("unable to load builtin function %s", my_name);
+    }
 
   return retval;
 }
--- a/src/variables.cc	Thu Sep 15 02:41:12 1994 +0000
+++ b/src/variables.cc	Thu Sep 15 02:47:09 1994 +0000
@@ -42,6 +42,7 @@
 
 #include "defaults.h"
 #include "version.h"
+#include "dynamic-ld.h"
 #include "octave-hist.h"
 #include "unwind-prot.h"
 #include "variables.h"
@@ -619,26 +620,22 @@
 
   char *nm = sym_rec->name ();
 
+// This is needed by yyparse.
+
   curr_fcn_file_name = nm;
 
-  char *oct_file = oct_file_in_path (curr_fcn_file_name);
-
-  int loaded_oct_file = 0;
-
-  if (oct_file)
-    {
-      cerr << "found: " << oct_file << "\n";
+#ifdef WITH_DLD
 
-      delete [] oct_file;
+  if (load_octave_oct_file (nm))
+    {
+      force_link_to_function (nm);
+    }
+  else
 
-// XXX FIXME XXX -- this is where we try to link to an external
-// object...
-      loaded_oct_file = 1;
-    }
+#endif
 
-  if (! loaded_oct_file)
     {
-      char *ff = fcn_file_in_path (curr_fcn_file_name);
+      char *ff = fcn_file_in_path (nm);
 
       if (ff)
 	{