[ruby-core:96007] [Ruby master Feature#16378] Support leading arguments together with ...
| Newsgroups | gmane.comp.lang.ruby.core |
|---|---|
| Message-ID | <redmine.journal-82845.20191128045607.8125b502b4aad592@ruby-lang.org> |
Issue #16378 has been updated by matz (Yukihiro Matsumoto).
Status changed from Open to Rejected
I know trailing `...` can be very useful from C experience. But the primary purpose of Ruby `...` is method delegation. We are not going to extend the role of `...` in the language (at least for now).
Matz.
----------------------------------------
Feature #16378: Support leading arguments together with ...
https://bugs.ruby-lang.org/issues/16378#change-82845
* Author: Eregon (Benoit Daloze)
* Status: Rejected
* Priority: Normal
* Assignee:
* Target version: 2.7
----------------------------------------
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:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>