From: "hsbt (Hiroshi SHIBATA)" Date: 2022-05-09T07:54:11+00:00 Subject: [ruby-core:108488] [Ruby master Bug#18765] Wrong description introduced by https://github.com/ruby/ruby/pull/4938/files Issue #18765 has been updated by hsbt (Hiroshi SHIBATA). Assignee set to burdettelamar@yahoo.com (Burdette Lamar) Status changed from Open to Assigned ---------------------------------------- Bug #18765: Wrong description introduced by https://github.com/ruby/ruby/pull/4938/files https://bugs.ruby-lang.org/issues/18765#change-97532 * Author: sawa (Tsuyoshi Sawada) * Status: Assigned * Priority: Normal * Assignee: burdettelamar@yahoo.com (Burdette Lamar) * ruby -v: 3.1.0 * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- Commit https://github.com/ruby/ruby/pull/4938/files introduced problems and made the description wrong. 1) For methods `slice_after` and `slice_when`, it introduces expressions like "partition elements into arrays ('slices')", and for method `chunk_while`, "partition elements into arrays ('chunks')". It suggests to call the resulting elements using different words depending on the name of the method. But that does not make sense. They are all simply arrays, and there is no need to distinguish a "slice array" from a "chunk array". (They can all be called an "array", "slice", or "chunk", or whatever.) Perhaps, it is attempting to explain where the method names came from, under the assumption that the words "slice" and "chunk" in these method names are nouns. If so, that is wrong. The succeeding parts "when (block)" and "while (block)" are (to correspond to English) adverbial clauses, not adjectival (relative) clauses; hence, these "slice" and "chunk" must be interpreted as verbs, not nouns. In fact, "a slice when y is not a successor of x" or "a chunk while y is a successor of x" does not make sense, whereas "slice it when y is not a successor of x" and "chunk them while y is a successor of x" do make sense. The difference between the "slice" and "chunk" methods lies in the process, not the return value. If you want to use these words, it can be something like "slice the receiver into arrays when the block returns a truthy value" and "chunk the elements together while the block returns a truthy value". 2) Crucially, in the description of `chunk_while`, the expression "begins a new chunk if and only if the block returns a truthy value" is entirely wrong. -- https://bugs.ruby-lang.org/ Unsubscribe: