Skip to content
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

Enumerable#chunk で、特別扱いされるブロックの評価値があることがわかりづらい #2308

Open
pocke opened this issue Jul 2, 2020 · 0 comments

Comments

@pocke
Copy link
Member

pocke commented Jul 2, 2020

https://docs.ruby-lang.org/ja/latest/method/Enumerable/i/chunk.html

Enumerable#chunkでは、ブロックの評価値が nil, :_separator, :_alone, その他の_から始まるシンボルであるときにそれを特別扱いします。

ところが、それに関する記述はサンプルコードを3つ挟んだ、ドキュメントの中盤にしか書かれていません。
そのため、ドキュメントをパット見ただけでは、特別扱いされる値があることを見落としてしまいそうです。

なので、特別扱いされるブロックの評価値に関しては、ドキュメントの上の方でも触れたほうが良いと思います。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant