ChaiScript
|
This file is not technically part of the ChaiScript API. More...
Classes | |
class | Const_Range |
A concept in ChaiScript that is implemented by string, Vector and Map. More... | |
class | Container |
A concept implemented by string, Vector and Map. It is convertible to Range, default constructable and back_insertable. More... | |
class | Function |
Represents a function object in ChaiScript. More... | |
class | Map |
Maps strings to Objects. More... | |
class | Map_Pair |
Item returned from a Range object from a Map. More... | |
class | Object |
Generic concept of a value in ChaiScript. More... | |
class | Range |
A concept in ChaiScript that is implemented by string, Vector and Map. More... | |
class | string |
ChaiScript representation of std::string. More... | |
class | Type_Info |
class | Vector |
A vector of Objects. More... | |
Functions | |
string | to_string (Object o) |
Converts o into a string. More... | |
void | puts (Object o) |
Prints o to the terminal, without a trailing carriage return. More... | |
void | print (Object o) |
Prints o to the terminal, with a trailing carriage return. More... | |
class ChaiScript_Language::Function | max (Object a, Object b) |
Returns the max of a or b. More... | |
Object | min (Object a, Object b) |
Returns the min of a or b. More... | |
bool | even (Object x) |
Returns true if x is an even integer. More... | |
void | for_each (Range c, Function f) |
Applies the function f over each element in the Range c. More... | |
Object | map (Range c, Function f) |
Applies f over each element in the Range c, joining all the results. More... | |
Object | foldl (Range c, Function f, Object initial) |
Starts with the initial value and applies the function f to it and the first element of the Range c. More... | |
Numeric | sum (Range c) |
Returns the sum total of the values in the Range c. More... | |
Numeric | product (Range c) |
Returns the product of the value in the Range c. More... | |
Object | take (Range c, int num) |
Takes num elements from the Range c, returning them. More... | |
Object | take_while (Range c, Function f) |
Takes elements from the Range c that match function f, stopping at the first non-match, returning them as a new Vector. More... | |
Object | drop (Range c, int num) |
Drops num elements from the Range c, returning the remainder. More... | |
Object | drop_while (Range c, Function f) |
Drops elements from the Range c that match f, stopping at the first non-match, returning the remainder. More... | |
Object | reduce (Range c, Function f) |
Similar to foldl, this takes the first two elements as its starting values for f. More... | |
Object | filter (Container c, Function f) |
Takes elements from Container c that match function f, return them. More... | |
string | join (Range c, string delim) |
Joins the elements of the Range c into a string, delimiting each with the delim string. More... | |
Container | reverse (Container c) |
Returns the contents of the Container c in reversed order. More... | |
Vector | generate_range (Object x, Object y) |
Generates a new Vector filled with values starting at x and ending with y. More... | |
Object | concat (Range x, Range y) |
Returns a new Range with x and y concatenated. More... | |
Vector | collate (Object x, Object y) |
Returns a new Vector with x and y as its values. More... | |
Vector | zip_with (Function f, Range x, Range y) |
Applies f to elements of x and y, returning a new Vector with the result of each application. More... | |
Vector | zip (Range x, Range y) |
Collates elements of x and y, returning a new Vector with the result. More... | |
bool | call_exists (Function f,...) |
returns true if there exists a call to the Function f that takes the given parameters More... | |
Range | retro (Range) |
Reverses a Range object so that the elements are accessed in reverse. | |
Const_Range | retro (Const_Range) |
Reverses a Const_Range object so that the elements are accessed in reverse. | |
void | throw (Object) |
Raises the given object as an exception. More... | |
This file is not technically part of the ChaiScript API.
It is used solely for generating Doxygen docs regarding the ChaiScript standard runtime library. Items in this namespace exist in the ChaiScript language runtime. They are not part of the C++ API
bool ChaiScript_Language::call_exists | ( | Function | f, |
... | |||
) |
returns true if there exists a call to the Function f that takes the given parameters
Example:
Drops elements from the Range c that match f, stopping at the first non-match, returning the remainder.
Example:
bool ChaiScript_Language::even | ( | Object | x | ) |
Returns true if x is an even integer.
Returns true if x is an odd integer.
Will also work on any non-integer type for which an operator%(x, int) exists
Example:
Will also work on any non-integer type for which an operator%(x, int) exists
Example:
Generates a new Vector filled with values starting at x and ending with y.
Works on types supporting operator<=(x, y) and operator++(x)
Example:
class ChaiScript_Language::Function ChaiScript_Language::max | ( | Object | a, |
Object | b | ||
) |
Returns the max of a or b.
Requires that operator>(a, b) exists Equivalent to
Example:
Returns the min of a or b.
Requires that operator<(a, b) exists
Equivalent to
Example:
void ChaiScript_Language::print | ( | Object | o | ) |
Numeric ChaiScript_Language::product | ( | Range | c | ) |
void ChaiScript_Language::puts | ( | Object | o | ) |
Numeric ChaiScript_Language::sum | ( | Range | c | ) |
Takes elements from the Range c that match function f, stopping at the first non-match, returning them as a new Vector.
Example:
void ChaiScript_Language::throw | ( | Object | ) |
Converts o into a string.