summaryrefslogtreecommitdiff
path: root/i/marvin/src/interpreter/interpreter.cc
diff options
context:
space:
mode:
Diffstat (limited to 'i/marvin/src/interpreter/interpreter.cc')
-rw-r--r--i/marvin/src/interpreter/interpreter.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/i/marvin/src/interpreter/interpreter.cc b/i/marvin/src/interpreter/interpreter.cc
index a160002..bbf4767 100644
--- a/i/marvin/src/interpreter/interpreter.cc
+++ b/i/marvin/src/interpreter/interpreter.cc
@@ -54,6 +54,15 @@ Interpreter::add (const std::string &s, Func *f)
add (s, f, "");
}
+/// Test if a function is defined.
+bool
+Interpreter::exists (const std::string &s) const
+{
+ Funcs::const_iterator i;
+ i = funcs_.find (s);
+ return i != funcs_.end ();
+}
+
/// Call a function by name.
void
Interpreter::call (const std::string &s, const Args &a,