diff --git a/include/chaiscript/language/chaiscript_prelude.hpp b/include/chaiscript/language/chaiscript_prelude.hpp index ac05bc2..1fd5c68 100644 --- a/include/chaiscript/language/chaiscript_prelude.hpp +++ b/include/chaiscript/language/chaiscript_prelude.hpp @@ -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\ diff --git a/include/chaiscript/language/chaiscript_prelude_docs.hpp b/include/chaiscript/language/chaiscript_prelude_docs.hpp index 2779d1e..ba3609e 100644 --- a/include/chaiscript/language/chaiscript_prelude_docs.hpp +++ b/include/chaiscript/language/chaiscript_prelude_docs.hpp @@ -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) } diff --git a/unittests/dispatch_functions.chai b/unittests/dispatch_functions.chai index ea7334e..528d5b3 100644 --- a/unittests/dispatch_functions.chai +++ b/unittests/dispatch_functions.chai @@ -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));