-
Notifications
You must be signed in to change notification settings - Fork 2
mint.range
load mint.range
This module provides a set of functions to perform operations on a range of
elements. The range of elements must implement the in
operator.
- accumulate
- accumulateIf
- adjacentFind
- allOf
- anyOf
- copy
- copyBackward
- copyIf
- copyN
- count
- countIf
- each
- eachN
- endsWith
- enumerate
- find
- findEnd
- findFirstOf
- findIf
- findIfNot
- iterator
- mismatch
- next
- noneOf
- reverse
- reversed
- search
- searchN
- slice
- startsWith
- transform
- transformIf
- zip
def (range, init)
Returns the result of the +
operator applied resursively to each values in
range
where predicate
returns true
for the value with an initial value
of init
.
def (range, init, func)
Returns the result of the func
function applied resursively to each values
in range
where predicate
returns true
for the value with an initial
value of init
.
def (range, init, predicate)
Returns the result of the +
operator applied resursively to each values in
range
with an initial value of init
.
def (range, init, predicate, func)
Returns the result of the func
function applied resursively to each values
in range
with an initial value of init
.
def (range)
Returns an iterator on the first element of range
that is equal to its next
element. The elements of range
must implement the ==
operator.
def (range, predicate)
Returns an iterator on the first element of range
where predicate
returns
true
when called with the element and its next element.
def (range, predicate)
Returns true
if predicate
returns true
for all elements in range
;
otherwie returns false
.
def (range, predicate)
Returns true
if predicate
returns true
for at least one element in
range
; otherwie returns false
.
def (range, other)
Copy all elements in other
to the corresponding element of range
. Returns
an iterator on the next element of range
.
def (range, other)
Copy all elements in other
to the corresponding element of range
starting
from the end. Returns a reversed iterator on the next element of range
.
def (range, other, predicate)
Copy all elements in other
for which predicate returns true
to the
corresponding element of range
. Returns an iterator on the next element of
range
.
def (range, n, other)
Copy the n
first elements in other
to the corresponding element of range
.
Returns an iterator on the next element of range
.
def (range)
Returns the number of elements in range
.
def (range, value)
Returns the number of elements in range
that is equal to value
. Both
range
elemnts and value
must implement the ==
operator.
def (range, predicate)
Returns the number of elements in range
for which predicate
returns
true
.
def (range, func)
Calls func
for each element in range
.
def (range, n, func)
Calls func
for the n
first elements in range
.
def (range, other)
Returns true
if the last elements of range
are equal to the elements of
other
; otherwise returns false
. The elements of range
and other
must
implement the ==
operator.
def (range, other, predicate)
Returns true
if the last elements of range
are equal to the elements of
other
; otherwise returns false
. The elements of range
and other
are
compared using predicate
.
def (range, from = 0)
Returns an iterator containing iterators with a counter starting from from
before each element contained in range
.
def (range, value)
Returns an iterator on the first element of range
that match value
. The
elements of range
must implement the ==
operator.
def (range, other)
Returns an iterator on the beginning of the last occurence of other
in
range
. The elements of range
and other
must implement the ==
operator.
def (range, other, predicate)
Returns an iterator on the beginning of the last occurence of other
in
range
. The elements of range
and other
are compared using predicate
.
def (range, values)
Returns an iterator on the first element of range
that is equal to an element
of values
. The elements of range
and values
must implement the ==
operator.
def (range, values, predicate)
Returns an iterator on the first element of range
where predicate
returns
true
for an element of values
.
def (range, predicate)
Returns an iterator on the first element of range
where predicate
returns
true
.
def (range, predicate)
Returns an iterator on the first element of range
where predicate
returns
false
.
def ()
Returns an empty iterator.
def (...)
Returns an iterator on each parameter passed to the function.
def (range, other)
Returns an iterator containing two iterators on the first non-equal elements
of range
and other
. The elements in the two ranges must implement the ==
operator.
def (range, other, predicate)
Returns an iterator containing two iterators on the first elements of range
and other
where predicate
returns false
.
def (range, step = 1)
Returns an iterator starting to the step
th next element in the object
provided by range
.
def (range, predicate)
Returns true
if predicate
returns true
for no elements in range
;
otherwie returns false
.
def (range)
Reverses the order of the elements in range
and returns range
.
def (range)
Returns an iterator on the elements of range
in reversed order.
def (range, other)
Returns an iterator on the beginning of the first occurence of other
in
range
. The elements of range
and other
must implement the ==
operator.
def (range, other, predicate)
Returns an iterator on the beginning of the first occurence of other
in
range
. The elements of range
and other
are compared using predicate
.
def (range, n, value)
Returns an iterator on the beginning of the first occurence of n
consecutive
elements equals to value
in range
. The elements of range
and value
must implement the ==
operator.
def (range, n, value, predicate)
Returns an iterator on the beginning of the first occurence of n
consecutive
elements equals to value
in range
. The elements of range
and value
are compared using predicate
.
def (range, from, to = none, step = 1)
Returns an iterator on each element contained in range
starting from the
from
th element and until the to
th element. If to
is not specified, the
object provided by the range
parameter must provides a size
method to get
the index of the last inserted value. If step
is provided, elements are
skeeped to provides only elements with an index that is a multiple of step
.
def (range, other)
Returns true
if the first elements of range
are equal to the elements of
other
; otherwise returns false
. The elements of range
and other
must
implement the ==
operator.
def (range, other, predicate)
Returns true
if the first elements of range
are equal to the elements of
other
; otherwise returns false
. The elements of range
and other
are
compared using predicate
.
def (range, func)
Returns an iterator containing each result of the func
function applied to
the values contained in range
.
def (range, predicate, func)
Returns an iterator containing each result of the func
function applied to
the values contained in range
where predicate
returns true
for the value.
def (range, ...)
Returns an iterator containing, iterators with, for each object passed as parameter, the value contained at the same position.
Language reference
- Introduction
- Variables
- Built-in types
- Arithmetic operations
- Type casting
- Control structures
- Function definition
- User defined types
- Work with modules
Library reference