diff src/variables.cc @ 4342:813effe14ee1

[project @ 2003-02-20 08:35:55 by jwe]
author jwe
date Thu, 20 Feb 2003 08:35:55 +0000
parents d53c33d93440
children 4e23bfdd6172
line wrap: on
line diff
--- a/src/variables.cc	Thu Feb 20 04:49:55 2003 +0000
+++ b/src/variables.cc	Thu Feb 20 08:35:55 2003 +0000
@@ -790,6 +790,39 @@
   return sym_rec;
 }
 
+octave_function *
+lookup_function (const std::string& nm)
+{
+  octave_function *retval = 0;
+
+  symbol_record *sr = 0;
+
+  if (curr_parent_function)
+    {
+      std::string parent = curr_parent_function->function_name ();
+
+      sr = fbi_sym_tab->lookup (parent + ":" + nm);
+    }
+
+  if (! sr || ! sr->is_function ())
+    {
+      sr = fbi_sym_tab->lookup (nm, true);
+
+      if (sr && ! sr->is_function ())
+	load_fcn_from_file (sr, false);
+    }
+
+  if (sr)
+    {
+      octave_value v = sr->def ();
+
+      if (v.is_function ())
+	retval = v.function_value ();
+    }
+
+  return retval;
+}
+
 octave_value
 get_global_value (const std::string& nm)
 {