Skip to content

Commit 07f4bc7

Browse files
committed
Improve paragraph on iterators (en)
1 parent 679b063 commit 07f4bc7

File tree

1 file changed

+3
-3
lines changed
  • en/documentation/ruby-from-other-languages/to-ruby-from-c-and-cpp

1 file changed

+3
-3
lines changed

en/documentation/ruby-from-other-languages/to-ruby-from-c-and-cpp/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,9 @@ Unlike C++, in Ruby,...
136136
object to a given variable, and types get figured out at runtime
137137
anyway). No casting either.
138138
* Iteration is done a bit differently. In Ruby, you don’t use a separate
139-
iterator object (like `vector<T>::const_iterator iter`) but instead
140-
your objects may mixin the `Enumerator` module and just make a method
141-
call like `my_obj.each`.
139+
iterator object (like `vector<T>::const_iterator iter`).
140+
Instead you use an iterator method of the container object (like `each`)
141+
that takes a block of code to which it passes successive elements.
142142
* There’s only two container types: `Array` and `Hash`.
143143
* There’s no type conversions. With Ruby though, you’ll probably find
144144
that they aren’t necessary.

0 commit comments

Comments
 (0)