diff src/variables.cc @ 3178:09a3064a3a17

[project @ 1998-06-23 03:46:42 by jwe]
author jwe
date Tue, 23 Jun 1998 03:47:31 +0000
parents e4bbfc196e53
children 041ea33fbbf4
line wrap: on
line diff
--- a/src/variables.cc
+++ b/src/variables.cc
@@ -134,23 +134,10 @@
 // Is this octave_value a valid function?
 
 octave_function *
-is_valid_function (const octave_value& arg, const string& warn_for, bool warn)
+is_valid_function (const string& fcn_name, const string& warn_for, bool warn)
 {
   octave_function *ans = 0;
 
-  string fcn_name;
-
-  if (arg.is_string ())
-    fcn_name = arg.string_value ();
-
-  if (fcn_name.empty () || error_state)
-    {
-      if (warn)
-	error ("%s: expecting function name as argument",
-	       warn_for.c_str ());
-      return ans;
-    }
-
   symbol_record *sr = 0;
 
   if (! fcn_name.empty ())
@@ -174,6 +161,24 @@
 }
 
 octave_function *
+is_valid_function (const octave_value& arg, const string& warn_for, bool warn)
+{
+  octave_function *ans = 0;
+
+  string fcn_name;
+
+  if (arg.is_string ())
+    fcn_name = arg.string_value ();
+
+  if (! error_state)
+    ans = is_valid_function (fcn_name, warn_for, warn);
+  else if (warn)
+    error ("%s: expecting function name as argument", warn_for.c_str ());
+
+  return ans;
+}
+
+octave_function *
 extract_function (const octave_value& arg, const string& warn_for,
 		  const string& fname, const string& header,
 		  const string& trailer)