Issue #12247 has been updated by Usaku NAKAMURA.


With my implementation (attached patch),

```ruby
ary = [1, 2, 3, 4, 5]
ary.delete(1, 6) # => [1]
ary              # => [2, 3, 4, 5]
```

Because if you want to get `[1, nil]`, you can write:

```ruby
ary = [1, 2, 3, 4, 5]
ary.delete(1, 6){ nil } # => [1, nil]
ary                     # => [2, 3, 4, 5]
```

That said, I am not convinced that this is the best behavior.

----------------------------------------
Feature #12247: accept multiple arguments at Array#delete
https://bugs.ruby-lang.org/issues/12247#change-57930

* Author: Usaku NAKAMURA
* Status: Open
* Priority: Normal
* Assignee: 
----------------------------------------
I found that it's very useful if `Array#delete` accepts multiple arguments.

```ruby
ary = [1, 2, 3, 4, 5]
ary.delete(1, 3)       #=> [1, 3]
ary                    #=> [2, 4, 5]
```

---Files--------------------------------
delete_multi.patch (4.6 KB)


-- 
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>