Fix failing unit tests related to recent renaming of function to Function

This commit is contained in:
Jason Turner
2011-04-26 10:17:24 -06:00
parent 61b8481514
commit e5f9dbb93b
3 changed files with 20 additions and 9 deletions

View File

@@ -313,7 +313,7 @@ def string::rtrim() { \n\
def string::trim() { \n\
ltrim(rtrim(this)); \n\
} \n\
def find(container, value, compare_func) : call_exists(range, container) && is_type(compare_func, "function") { \n\
def find(container, value, compare_func) : call_exists(range, container) && is_type(compare_func, "Function") { \n\
var range = range(container); \n\
while (!range.empty()) { \n\
if (compare_func(range.front(), value)) { \n\

View File

@@ -14,9 +14,6 @@ namespace ChaiScript_Language
///
/// \section LibraryStrings Strings
///
/// \brief Converts o into a string.
///
@@ -148,6 +145,20 @@ class string
string trim() const;
};
class Function
{
public:
};
/// \brief Generic concept of a value in ChaiScript.
///
/// The Object type exists merely as a concept. All objects in ChaiScript support this concept
/// and have the following methods available to them. All objects are stored internally as chaiscript::Boxed_Value types.
class Object
{
public:
}
/// \brief Returns the max of a or b. Requires that operator>(a, b) exists
/// Equivalent to
/// \code
@@ -366,7 +377,7 @@ Vector generate_range(Object x, Object y)
/// eval> concat([1, 2, 3], [4, 5, 6])
/// [1, 2, 3, 4, 5, 6]
/// \endcode
concat(Container x, Container y)
Object concat(Container x, Container y)
/// \brief Returns a new Vector with x and y as its values.
@@ -376,7 +387,7 @@ concat(Container x, Container y)
/// eval> collate(1, 2)
/// [1, 2]
/// \endcode
collate(x, y)
Vector collate(x, y)
/// \brief Applies f to elements of x and y, returning a new Vector with the result of each application.
@@ -386,7 +397,7 @@ collate(x, y)
/// eval> zip_with(`+`, [1, 2, 3], [4, 5, 6])
/// [5, 7, 9]
/// \endcode
zip_with(Function f, x, y)
Vector zip_with(Function f, Container x, Container y)
/// \brief Collates elements of x and y, returning a new Vector with the result.
@@ -396,7 +407,7 @@ zip_with(Function f, x, y)
/// eval> zip([1, 2, 3], [4, 5, 6])
/// [[1, 4], [2, 5], [3, 6]]
/// \endcode
zip(x, y)
Vector zip(Container x, Container y)
}

View File

@@ -8,4 +8,4 @@ assert_equal(get_arity.get_param_types().size(), 2);
var paramtypes = get_arity.get_param_types();
assert_equal(true, paramtypes[1].bare_equal(function_type));
assert_equal(true, paramtypes[1].bare_equal(Function_type));