Skip to content

Commit 8ace7fd

Browse files
committed
Merge pull request ruby#1397 from snoozer05/ja-update-ruby-from-other-languages
Improve paragraph on iterators (ja)
2 parents e648b9b + 9a25c91 commit 8ace7fd

File tree

1 file changed

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

1 file changed

+3
-3
lines changed

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ C++と違って、Rubyは...
109109
* どんな種類のオブジェクトでも変数に設定でき、型は実行時に評価されるので、
110110
C++テンプレートは必要ありません。キャストもありません。
111111
* イテレーションはわずかな違いがあります。
112-
Rubyでは、(`vector<T>::const_iterator iter`のような)独立したイテレータ・オブジェクトは使いません
113-
代わりに、オブジェクトは`Enumerator`モジュールをMix-inし、
114-
`my_obj.each`のように呼び出すメソッドを作成する必要があります
112+
Rubyでは、`vector<T>::const_iterator iter`のような独立したイテレータオブジェクトは使いません
113+
代わりに、コンテナオブジェクトが持つ`each`などのイテレータメソッドを使います。
114+
イテレータメソッドはコード片を受け取り、それを各要素へと順に渡していきます
115115
* コンテナクラスは`Array``Hash`の2種類だけです。
116116
* 型変換はありません。Rubyを使い始めれば、必要ない理由がわかるはずです。
117117
* マルチスレッド機能は組み込まれています。

0 commit comments

Comments
 (0)