Skip to content

Improve paragraph on iterators (ja) #1397

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 19, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

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