[ruby-core:86489] [Ruby trunk Misc#14673] Documentation for `Array#drop` / `drop_while` unclear in regard to modification

From: mail@...
Date: 2018-04-10 09:51:51 UTC
List: ruby-core #86489
Issue #14673 has been reported by sos4nt (Stefan Schテシテ殕er).

----------------------------------------
Misc #14673: Documentation for `Array#drop` / `drop_while` unclear in regard to modification
https://bugs.ruby-lang.org/issues/14673

* Author: sos4nt (Stefan Schテシテ殕er)
* Status: Open
* Priority: Normal
* Assignee: 
----------------------------------------
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/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next