Throw eval exception if a variable or function is redefined #28

This commit is contained in:
Jason Turner
2012-05-16 11:40:43 -06:00
parent 7deb2311f5
commit 4bcaa75fa4
9 changed files with 83 additions and 29 deletions

View File

@@ -219,7 +219,12 @@ namespace chaiscript
virtual bool operator==(const Proxy_Function_Base &rhs) const
{
return this == &rhs;
const Dynamic_Proxy_Function *prhs = dynamic_cast<const Dynamic_Proxy_Function *>(&rhs);
return this == &rhs
|| (prhs
&& this->m_arity == prhs->m_arity
&& !this->m_guard && !prhs->m_guard);
}
virtual bool call_match(const std::vector<Boxed_Value> &vals) const