[ruby-core:96519] [Ruby master Feature#16378] Support leading arguments together with ...
From:
eregontp@...
Date:
2019-12-27 18:15:00 UTC
List:
ruby-core #96519
Issue #16378 has been updated by Eregon (Benoit Daloze).
Target version changed from 2.7 to 3.0
Assignee set to matz (Yukihiro Matsumoto)
Status changed from Rejected to Open
@matz Could you reply to this?
Particularly:
> But the primary purpose of Ruby ... is method delegation.
Indeed, and I believe we also want to extract leading arguments in many delegation use cases.
`...` not supporting leading arguments is a obvious limitation and I would think unexpected for many rubyists.
As an example, it makes `...` unusable for method_missing, which is a place where delegation often happens.
I think the decision was too quick, maybe because I set target version 2.7.
It won't be in 2.7 since that's released, but let's consider it for future releases.
----------------------------------------
Feature #16378: Support leading arguments together with ...
https://bugs.ruby-lang.org/issues/16378#change-83450
* Author: Eregon (Benoit Daloze)
* Status: Open
* Priority: Normal
* Assignee: matz (Yukihiro Matsumoto)
* Target version: 3.0
----------------------------------------
I think this is very important, otherwise `...` can be used only very rarely.
For instance, `method_missing` typically want to access the method name like:
```ruby
def method_missing(name, ...)
if name.to_s.end_with?('?')
self[name]
else
fallback(name, ...)
end
end
```
See the original feature: https://bugs.ruby-lang.org/issues/16253#note-19.
I think most people expect `def method_missing(name, ...)` to work.
--
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>