Rename types_match to call_match in Proxy_Function to more closely match the semantics of the call
This commit is contained in:
parent
ba6b392174
commit
0ff107a818
@ -635,7 +635,7 @@ namespace chaiscript
|
||||
|
||||
Proxy_Function f = boxed_cast<Proxy_Function >(params[0]);
|
||||
|
||||
return Boxed_Value(f->types_match(std::vector<Boxed_Value>(params.begin() + 1, params.end())));
|
||||
return Boxed_Value(f->call_match(std::vector<Boxed_Value>(params.begin() + 1, params.end())));
|
||||
}
|
||||
|
||||
static boost::shared_ptr<Dispatch_Engine> bootstrap2(boost::shared_ptr<Dispatch_Engine> e = boost::shared_ptr<Dispatch_Engine> (new Dispatch_Engine()))
|
||||
|
@ -94,7 +94,7 @@ namespace chaiscript
|
||||
return std::vector<Type_Info>();
|
||||
}
|
||||
|
||||
virtual bool types_match(const std::vector<Boxed_Value> &types) const
|
||||
virtual bool call_match(const std::vector<Boxed_Value> &vals) const
|
||||
{
|
||||
typedef std::vector<std::pair<std::string, Proxy_Function > > function_vec;
|
||||
|
||||
@ -103,7 +103,7 @@ namespace chaiscript
|
||||
|
||||
while (begin != end)
|
||||
{
|
||||
if (begin->second->types_match(types))
|
||||
if (begin->second->call_match(vals))
|
||||
{
|
||||
return true;
|
||||
} else {
|
||||
|
@ -177,7 +177,7 @@ namespace chaiscript
|
||||
virtual Boxed_Value operator()(const std::vector<Boxed_Value> ¶ms) = 0;
|
||||
virtual std::vector<Type_Info> get_param_types() const = 0;
|
||||
virtual bool operator==(const Proxy_Function_Base &) const = 0;
|
||||
virtual bool types_match(const std::vector<Boxed_Value> &types) const = 0;
|
||||
virtual bool call_match(const std::vector<Boxed_Value> &vals) const = 0;
|
||||
virtual std::string annotation() const = 0;
|
||||
};
|
||||
|
||||
@ -218,10 +218,10 @@ namespace chaiscript
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual bool types_match(const std::vector<Boxed_Value> &types) const
|
||||
virtual bool call_match(const std::vector<Boxed_Value> &vals) const
|
||||
{
|
||||
return (m_arity < 0 || types.size() == size_t(m_arity))
|
||||
&& test_guard(types);
|
||||
return (m_arity < 0 || vals.size() == size_t(m_arity))
|
||||
&& test_guard(vals);
|
||||
}
|
||||
|
||||
virtual ~Dynamic_Proxy_Function() {}
|
||||
@ -320,10 +320,9 @@ namespace chaiscript
|
||||
|
||||
virtual ~Bound_Function() {}
|
||||
|
||||
virtual bool types_match(const std::vector<Boxed_Value> &types) const
|
||||
virtual bool call_match(const std::vector<Boxed_Value> &vals) const
|
||||
{
|
||||
std::vector<Boxed_Value> params = build_param_list(types);
|
||||
return m_f->types_match(params);
|
||||
return m_f->call_match(build_param_list(vals));
|
||||
}
|
||||
|
||||
virtual Boxed_Value operator()(const std::vector<Boxed_Value> ¶ms)
|
||||
@ -421,10 +420,10 @@ namespace chaiscript
|
||||
return build_param_type_list(f);
|
||||
}
|
||||
|
||||
virtual bool types_match(const std::vector<Boxed_Value> &types) const
|
||||
virtual bool call_match(const std::vector<Boxed_Value> &vals) const
|
||||
{
|
||||
Func *f = 0;
|
||||
return compare_types(f, types);
|
||||
return compare_types(f, vals);
|
||||
}
|
||||
|
||||
virtual std::string annotation() const
|
||||
|
Loading…
x
Reference in New Issue
Block a user