summaryrefslogtreecommitdiff
path: root/enum.c
diff options
context:
space:
mode:
authormarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-17 21:31:22 +0000
committermarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-17 21:31:22 +0000
commitc1ecff1b1e2eb1c4a10e305dd6cc25d7a94436f6 (patch)
treeb89029a472c274adcef054d03a694fd5905780cf /enum.c
parentef83d7a928ef9d998dc9cf9cb86649cdd9ffceea (diff)
downloadruby-c1ecff1b1e2eb1c4a10e305dd6cc25d7a94436f6.tar.gz
* hash.c: Documentation: change => in call-seq to ->.
* enum.c: Documentation: whitespace fix for r27865 * error.c: ditto * file.c: ditto * io.c: ditto * load.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enum.c')
-rw-r--r--enum.c168
1 files changed, 84 insertions, 84 deletions
diff --git a/enum.c b/enum.c
index 2162ff8b15..823eef6aa4 100644
--- a/enum.c
+++ b/enum.c
@@ -56,8 +56,8 @@ grep_iter_i(VALUE i, VALUE args, int argc, VALUE *argv)
/*
* call-seq:
- * enum.grep(pattern) ->array
- * enum.grep(pattern) {| obj | block } ->array
+ * enum.grep(pattern) -> array
+ * enum.grep(pattern) {| obj | block } -> array
*
* Returns an array of every element in <i>enum</i> for which
* <code>Pattern === element</code>. If the optional <em>block</em> is
@@ -121,9 +121,9 @@ count_all_i(VALUE i, VALUE memop, int argc, VALUE *argv)
/*
* call-seq:
- * enum.count ->int
- * enum.count(item) ->int
- * enum.count {| obj | block } ->int
+ * enum.count -> int
+ * enum.count(item) -> int
+ * enum.count {| obj | block } -> int
*
* Returns the number of items in <i>enum</i>, where #size is called
* if it responds to it, otherwise the items are counted through
@@ -179,10 +179,10 @@ find_i(VALUE i, VALUE *memo, int argc, VALUE *argv)
/*
* call-seq:
- * enum.detect(ifnone = nil) {| obj | block } ->obj or nil
- * enum.find(ifnone = nil) {| obj | block } ->obj or nil
- * enum.detect(ifnone = nil) ->an_enumerator
- * enum.find(ifnone = nil) ->an_enumerator
+ * enum.detect(ifnone = nil) {| obj | block } -> obj or nil
+ * enum.find(ifnone = nil) {| obj | block } -> obj or nil
+ * enum.detect(ifnone = nil) -> an_enumerator
+ * enum.find(ifnone = nil) -> an_enumerator
*
* Passes each entry in <i>enum</i> to <em>block</em>. Returns the
* first for which <em>block</em> is not false. If no
@@ -244,9 +244,9 @@ find_index_iter_i(VALUE i, VALUE memop, int argc, VALUE *argv)
/*
* call-seq:
- * enum.find_index(value) ->int or nil
- * enum.find_index {| obj | block } ->int or nil
- * enum.find_index ->an_enumerator
+ * enum.find_index(value) -> int or nil
+ * enum.find_index {| obj | block } -> int or nil
+ * enum.find_index -> an_enumerator
*
* Compares each entry in <i>enum</i> with <em>value</em> or passes
* to <em>block</em>. Returns the index for the first for which the
@@ -298,10 +298,10 @@ find_all_i(VALUE i, VALUE ary, int argc, VALUE *argv)
/*
* call-seq:
- * enum.find_all {| obj | block } ->array
- * enum.select {| obj | block } ->array
- * enum.find_all ->an_enumerator
- * enum.select ->an_enumerator
+ * enum.find_all {| obj | block } -> array
+ * enum.select {| obj | block } -> array
+ * enum.find_all -> an_enumerator
+ * enum.select -> an_enumerator
*
* Returns an array containing all elements of <i>enum</i> for which
* <em>block</em> is not <code>false</code> (see also
@@ -340,8 +340,8 @@ reject_i(VALUE i, VALUE ary, int argc, VALUE *argv)
/*
* call-seq:
- * enum.reject {| obj | block } ->array
- * enum.reject ->an_enumerator
+ * enum.reject {| obj | block } -> array
+ * enum.reject -> an_enumerator
*
* Returns an array for all elements of <i>enum</i> for which
* <em>block</em> is false (see also <code>Enumerable#find_all</code>).
@@ -384,10 +384,10 @@ collect_all(VALUE i, VALUE ary, int argc, VALUE *argv)
/*
* call-seq:
- * enum.collect {| obj | block } ->array
- * enum.map {| obj | block } ->array
- * enum.collect ->an_enumerator
- * enum.map ->an_enumerator
+ * enum.collect {| obj | block } -> array
+ * enum.map {| obj | block } -> array
+ * enum.collect -> an_enumerator
+ * enum.map -> an_enumerator
*
* Returns a new array with the results of running <em>block</em> once
* for every element in <i>enum</i>.
@@ -431,10 +431,10 @@ flat_map_i(VALUE i, VALUE ary, int argc, VALUE *argv)
/*
* call-seq:
- * enum.flat_map {| obj | block } ->array
- * enum.collect_concat {| obj | block } ->array
- * enum.flat_map ->an_enumerator
- * enum.collect_concat ->an_enumerator
+ * enum.flat_map {| obj | block } -> array
+ * enum.collect_concat {| obj | block } -> array
+ * enum.flat_map -> an_enumerator
+ * enum.collect_concat -> an_enumerator
*
* Returns a new array with the concatenated results of running
* <em>block</em> once for every element in <i>enum</i>.
@@ -460,8 +460,8 @@ enum_flat_map(VALUE obj)
/*
* call-seq:
- * enum.to_a -> array
- * enum.entries -> array
+ * enum.to_a -> array
+ * enum.entries -> array
*
* Returns an array containing the items in <i>enum</i>.
*
@@ -514,14 +514,14 @@ inject_op_i(VALUE i, VALUE p, int argc, VALUE *argv)
/*
* call-seq:
* enum.inject(initial, sym)->obj
- * enum.inject(sym) ->obj
- * enum.inject(initial) {| memo, obj | block } ->obj
- * enum.inject {| memo, obj | block } ->obj
+ * enum.inject(sym) -> obj
+ * enum.inject(initial) {| memo, obj | block } -> obj
+ * enum.inject {| memo, obj | block } -> obj
*
* enum.reduce(initial, sym)->obj
- * enum.reduce(sym) ->obj
- * enum.reduce(initial) {| memo, obj | block } ->obj
- * enum.reduce {| memo, obj | block } ->obj
+ * enum.reduce(sym) -> obj
+ * enum.reduce(initial) {| memo, obj | block } -> obj
+ * enum.reduce {| memo, obj | block } -> obj
*
* Combines all elements of <i>enum</i> by applying a binary
* operation, specified by a block or a symbol that names a
@@ -603,8 +603,8 @@ partition_i(VALUE i, VALUE *ary, int argc, VALUE *argv)
/*
* call-seq:
- * enum.partition {| obj | block } ->[ true_array, false_array ]
- * enum.partition ->an_enumerator
+ * enum.partition {| obj | block } -> [ true_array, false_array ]
+ * enum.partition -> an_enumerator
*
* Returns two arrays, the first containing the elements of
* <i>enum</i> for which the block evaluates to true, the second
@@ -652,8 +652,8 @@ group_by_i(VALUE i, VALUE hash, int argc, VALUE *argv)
/*
* call-seq:
- * enum.group_by {| obj | block } ->a_hash
- * enum.group_by ->an_enumerator
+ * enum.group_by {| obj | block } -> a_hash
+ * enum.group_by -> an_enumerator
*
* Returns a hash, which keys are evaluated result from the
* block, and values are arrays of elements in <i>enum</i>
@@ -703,8 +703,8 @@ first_i(VALUE i, VALUE *params, int argc, VALUE *argv)
/*
* call-seq:
- * enum.first -> obj or nil
- * enum.first(n) -> an_array
+ * enum.first -> obj or nil
+ * enum.first(n) -> an_array
*
* Returns the first element, or the first +n+ elements, of the enumerable.
* If the enumerable is empty, the first form returns <code>nil</code>, and the
@@ -740,8 +740,8 @@ enum_first(int argc, VALUE *argv, VALUE obj)
/*
* call-seq:
- * enum.sort ->array
- * enum.sort {| a, b | block } ->array
+ * enum.sort -> array
+ * enum.sort {| a, b | block } -> array
*
* Returns an array containing the items in <i>enum</i> sorted,
* either according to their own <code><=></code> method, or by using
@@ -792,8 +792,8 @@ sort_by_cmp(const void *ap, const void *bp, void *data)
/*
* call-seq:
- * enum.sort_by {| obj | block } ->array
- * enum.sort_by ->an_enumerator
+ * enum.sort_by {| obj | block } -> array
+ * enum.sort_by -> an_enumerator
*
* Sorts <i>enum</i> using a set of keys generated by mapping the
* values in <i>enum</i> through the given block.
@@ -924,7 +924,7 @@ DEFINE_ENUMFUNCS(all)
/*
* call-seq:
- * enum.all? [{|obj| block } ] ->true or false
+ * enum.all? [{|obj| block } ] -> true or false
*
* Passes each element of the collection to the given block. The method
* returns <code>true</code> if the block never returns
@@ -959,7 +959,7 @@ DEFINE_ENUMFUNCS(any)
/*
* call-seq:
- * enum.any? [{|obj| block } ] ->true or false
+ * enum.any? [{|obj| block } ] -> true or false
*
* Passes each element of the collection to the given block. The method
* returns <code>true</code> if the block ever returns a value other
@@ -1000,7 +1000,7 @@ DEFINE_ENUMFUNCS(one)
/*
* call-seq:
- * enum.one? [{|obj| block }] ->true or false
+ * enum.one? [{|obj| block }] -> true or false
*
* Passes each element of the collection to the given block. The method
* returns <code>true</code> if the block returns <code>true</code>
@@ -1037,7 +1037,7 @@ DEFINE_ENUMFUNCS(none)
/*
* call-seq:
- * enum.none? [{|obj| block }] ->true or false
+ * enum.none? [{|obj| block }] -> true or false
*
* Passes each element of the collection to the given block. The method
* returns <code>true</code> if the block never returns <code>true</code>
@@ -1100,8 +1100,8 @@ min_ii(VALUE i, VALUE *memo, int argc, VALUE *argv)
/*
* call-seq:
- * enum.min ->obj
- * enum.min {| a,b | block } ->obj
+ * enum.min -> obj
+ * enum.min {| a,b | block } -> obj
*
* Returns the object in <i>enum</i> with the minimum value. The
* first form assumes all objects implement <code>Comparable</code>;
@@ -1167,8 +1167,8 @@ max_ii(VALUE i, VALUE *memo, int argc, VALUE *argv)
/*
* call-seq:
- * enum.max ->obj
- * enum.max {|a,b| block } ->obj
+ * enum.max -> obj
+ * enum.max {|a,b| block } -> obj
*
* Returns the object in _enum_ with the maximum value. The
* first form assumes all objects implement <code>Comparable</code>;
@@ -1306,8 +1306,8 @@ minmax_ii(VALUE i, VALUE _memo, int argc, VALUE *argv)
/*
* call-seq:
- * enum.minmax ->[min,max]
- * enum.minmax {|a,b| block } ->[min,max]
+ * enum.minmax -> [min,max]
+ * enum.minmax {|a,b| block } -> [min,max]
*
* Returns two elements array which contains the minimum and the
* maximum value in the enumerable. The first form assumes all
@@ -1365,8 +1365,8 @@ min_by_i(VALUE i, VALUE *memo, int argc, VALUE *argv)
/*
* call-seq:
- * enum.min_by {|obj| block } ->obj
- * enum.min_by ->an_enumerator
+ * enum.min_by {|obj| block } -> obj
+ * enum.min_by -> an_enumerator
*
* Returns the object in <i>enum</i> that gives the minimum
* value from the given block.
@@ -1411,8 +1411,8 @@ max_by_i(VALUE i, VALUE *memo, int argc, VALUE *argv)
/*
* call-seq:
- * enum.max_by {|obj| block } ->obj
- * enum.max_by ->an_enumerator
+ * enum.max_by {|obj| block } -> obj
+ * enum.max_by -> an_enumerator
*
* Returns the object in <i>enum</i> that gives the maximum
* value from the given block.
@@ -1508,8 +1508,8 @@ minmax_by_i(VALUE i, VALUE _memo, int argc, VALUE *argv)
/*
* call-seq:
- * enum.minmax_by {|obj| block } ->[min, max]
- * enum.minmax_by ->an_enumerator
+ * enum.minmax_by {|obj| block } -> [min, max]
+ * enum.minmax_by -> an_enumerator
*
* Returns two elements array array containing the objects in
* <i>enum</i> that gives the minimum and maximum values respectively
@@ -1552,8 +1552,8 @@ member_i(VALUE iter, VALUE *memo, int argc, VALUE *argv)
/*
* call-seq:
- * enum.include?(obj) ->true or false
- * enum.member?(obj) ->true or false
+ * enum.include?(obj) -> true or false
+ * enum.member?(obj) -> true or false
*
* Returns <code>true</code> if any member of <i>enum</i> equals
* <i>obj</i>. Equality is tested using <code>==</code>.
@@ -1584,8 +1584,8 @@ each_with_index_i(VALUE i, VALUE memo, int argc, VALUE *argv)
/*
* call-seq:
- * enum.each_with_index(*args) {|obj, i| block } -> enum
- * enum.each_with_index(*args) -> an_enumerator
+ * enum.each_with_index(*args) {|obj, i| block } -> enum
+ * enum.each_with_index(*args) -> an_enumerator
*
* Calls <em>block</em> with two arguments, the item and its index,
* for each item in <i>enum</i>. Given arguments are passed through
@@ -1616,8 +1616,8 @@ enum_each_with_index(int argc, VALUE *argv, VALUE obj)
/*
* call-seq:
- * enum.reverse_each(*args) {|item| block } -> enum
- * enum.reverse_each(*args) -> an_enumerator
+ * enum.reverse_each(*args) {|item| block } -> enum
+ * enum.reverse_each(*args) -> an_enumerator
*
* Builds a temporary array and traverses that array in reverse order.
*
@@ -1653,8 +1653,8 @@ each_val_i(VALUE i, VALUE p, int argc, VALUE *argv)
/*
* call-seq:
- * enum.each_entry {|obj| block} ->enum
- * enum.each_entry ->an_enumerator
+ * enum.each_entry {|obj| block} -> enum
+ * enum.each_entry -> an_enumerator
*
* Calls <i>block</i> once for each element in +self+, passing that
* element as a parameter, converting multiple values from yield to an
@@ -1704,8 +1704,8 @@ each_slice_i(VALUE i, VALUE *memo, int argc, VALUE *argv)
/*
* call-seq:
- * enum.each_slice(n) {...} -> nil
- * enum.each_slice(n) -> an_enumerator
+ * enum.each_slice(n) {...} -> nil
+ * enum.each_slice(n) -> an_enumerator
*
* Iterates the given block for each slice of <n> elements. If no
* block is given, returns an enumerator.
@@ -1758,8 +1758,8 @@ each_cons_i(VALUE i, VALUE *memo, int argc, VALUE *argv)
/*
* call-seq:
- * enum.each_cons(n) {...} -> nil
- * enum.each_cons(n) -> an_enumerator
+ * enum.each_cons(n) {...} -> nil
+ * enum.each_cons(n) -> an_enumerator
*
* Iterates the given block for each array of consecutive <n>
* elements. If no block is given, returns an enumerator.
@@ -1802,8 +1802,8 @@ each_with_object_i(VALUE i, VALUE memo, int argc, VALUE *argv)
/*
* call-seq:
- * enum.each_with_object(obj) {|(*args), memo_obj| ... } -> obj
- * enum.each_with_object(obj) -> an_enumerator
+ * enum.each_with_object(obj) {|(*args), memo_obj| ... } -> obj
+ * enum.each_with_object(obj) -> an_enumerator
*
* Iterates the given block for each element with an arbitrary
* object given, and returns the initially given object.
@@ -1904,8 +1904,8 @@ zip_i(VALUE val, NODE *memo, int argc, VALUE *argv)
/*
* call-seq:
- * enum.zip(arg, ...) ->an_enumerator
- * enum.zip(arg, ...) {|arr| block } ->nil
+ * enum.zip(arg, ...) -> an_enumerator
+ * enum.zip(arg, ...) {|arr| block } -> nil
*
* Takes one element from <i>enum</i> and merges corresponding
* elements from each <i>args</i>. This generates a sequence of
@@ -1970,7 +1970,7 @@ take_i(VALUE i, VALUE *arg, int argc, VALUE *argv)
/*
* call-seq:
- * enum.take(n) ->array
+ * enum.take(n) -> array
*
* Returns first n elements from <i>enum</i>.
*
@@ -2007,8 +2007,8 @@ take_while_i(VALUE i, VALUE *ary, int argc, VALUE *argv)
/*
* call-seq:
- * enum.take_while {|arr| block } ->array
- * enum.take_while ->an_enumerator
+ * enum.take_while {|arr| block } -> array
+ * enum.take_while -> an_enumerator
*
* Passes elements to the block until the block returns +nil+ or +false+,
* then stops iterating and returns an array of all prior elements.
@@ -2045,7 +2045,7 @@ drop_i(VALUE i, VALUE *arg, int argc, VALUE *argv)
/*
* call-seq:
- * enum.drop(n) ->array
+ * enum.drop(n) -> array
*
* Drops first n elements from <i>enum</i>, and returns rest elements
* in an array.
@@ -2088,8 +2088,8 @@ drop_while_i(VALUE i, VALUE *args, int argc, VALUE *argv)
/*
* call-seq:
- * enum.drop_while {|arr| block } ->array
- * enum.drop_while ->an_enumerator
+ * enum.drop_while {|arr| block } -> array
+ * enum.drop_while -> an_enumerator
*
* Drops elements up to, but not including, the first element for
* which the block returns +nil+ or +false+ and returns an array
@@ -2126,8 +2126,8 @@ cycle_i(VALUE i, VALUE ary, int argc, VALUE *argv)
/*
* call-seq:
- * enum.cycle(n=nil) {|obj| block } -> nil
- * enum.cycle(n=nil) -> an_enumerator
+ * enum.cycle(n=nil) {|obj| block } -> nil
+ * enum.cycle(n=nil) -> an_enumerator
*
* Calls <i>block</i> for each element of <i>enum</i> repeatedly _n_
* times or forever if none or +nil+ is given. If a non-positive