From: "Earlopain (Earlopain _) via ruby-core" Date: 2026-08-16T14:03:10+00:00 Subject: [ruby-core:126412] [Ruby Misc#14673] Documentation for `Array#drop` / `drop_while` unclear in regard to modification Issue #14673 has been updated by Earlopain (Earlopain _). Status changed from Open to Closed Docs today say this: > Returns a new array containing all but the first count element of self, where count is a non-negative integer; does not modify self. ---------------------------------------- Misc #14673: Documentation for `Array#drop` / `drop_while` unclear in regard to modification https://bugs.ruby-lang.org/issues/14673#change-118554 * Author: sos4nt (Stefan Sch��ler) * Status: Closed ---------------------------------------- The documentation for [`Array#drop`](http://ruby-doc.org/core-2.5.0/Array.html#method-i-drop) says: > Drops first `n` elements from `ary` and returns the rest of the elements in an array. It's unclear if the receiver is being changed or not (it is not). The documentation should be more explicit in that regard. Maybe something like _"Returns a new array containing all except the first `n` elements from `ary`"_. This also applies to `Array#drop_while`. -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/