From: "Eregon (Benoit Daloze)" Date: 2021-12-14T11:26:34+00:00 Subject: [ruby-core:106652] [Ruby master Feature#18351] Support anonymous rest and keyword rest argument forwarding Issue #18351 has been updated by Eregon (Benoit Daloze). jeremyevans0 (Jeremy Evans) wrote in #note-4: > Can anyone show a problem with having Method#parameters for `foo(...)` and `def foo(*, **, &)` return the same result? I think there may be value to distinguish `...` and `*, **, &`. That's pretty much the subject of #16456. For instance a method taking `...` seems to very very likely use delegation, while a method using `*, **, &` not necessarily (e.g., it could pass positional to one methods, kwargs to another and block to a third method). Another issue is if one wants to detect `...` they would actually need to check `parameters == [[:rest, :*], [:keyrest, :**], [:block, :&]]` and not e.g. just `parameters.include?([:rest, :*])` which would also be true for `def m(*)`. Also, this changes the parameters for `def m(*)` from `[[:rest]]` to `[[:rest, :*]]`, I think that's bad as some code might rely on that. ---------------------------------------- Feature #18351: Support anonymous rest and keyword rest argument forwarding https://bugs.ruby-lang.org/issues/18351#change-95324 * Author: jeremyevans0 (Jeremy Evans) * Status: Open * Priority: Normal * Assignee: matz (Yukihiro Matsumoto) ---------------------------------------- I would like to add support for the following syntax: ```ruby def foo(*) bar(*) end def baz(**) quux(**) end ``` This is a natural addition after the introduction of anonymous block forwarding. Anonymous rest and keyword rest arguments were already supported in method parameters, this just allows them to be used as arguments to other methods. The same advantages of anonymous block forwarding apply to rest and keyword rest argument forwarding. I've submitted a pull request implementing this syntax: https://github.com/ruby/ruby/pull/5148 -- https://bugs.ruby-lang.org/ Unsubscribe: