Add function meta data functions, plus related tests, and some various cleanups for how functions are constructed internally

This commit is contained in:
Jason Turner
2010-10-14 14:33:17 +00:00
parent 0caa782437
commit 2cdfac4e47
8 changed files with 243 additions and 27 deletions

View File

@@ -449,26 +449,27 @@ namespace detail {
assignable_type<VectorType>(type, m);
input_range_type<VectorType>(type, m);
m->eval("def Vector::`==`(rhs) : type_match(rhs, this) { \
if ( rhs.size() != this.size() ) { \
return false; \
} else { \
var r1 = range(this); \
var r2 = range(rhs); \
while (!r1.empty()) \
{ \
if (!eq(r1.front(), r2.front())) \
if (typeid(VectorType) == typeid(std::vector<Boxed_Value>))
{
m->eval("def Vector::`==`(rhs) : type_match(rhs, this) { \
if ( rhs.size() != this.size() ) { \
return false; \
} else { \
var r1 = range(this); \
var r2 = range(rhs); \
while (!r1.empty()) \
{ \
return false; \
if (!eq(r1.front(), r2.front())) \
{ \
return false; \
} \
r1.pop_front(); \
r2.pop_front(); \
} \
r1.pop_front(); \
r2.pop_front(); \
} \
return true; \
} \
}");
return true; \
} \
}");
}
return m;
}