Project

General

Profile

Feature #16378

Support leading arguments together with ...

Added by Eregon (Benoit Daloze) about 1 year ago. Updated 21 days ago.

Status:
Closed
Priority:
Normal
Target version:
[ruby-core:95993]

Description

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:

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.


Files

ruby_2_7_lead_args_forwarding.patch (8.98 KB) ruby_2_7_lead_args_forwarding.patch jeremyevans0 (Jeremy Evans), 06/19/2020 04:20 PM

Related issues

Related to Ruby master - Feature #16253: Shorthand "forward everything" syntaxClosedActions
Related to Ruby master - Feature #16891: Restore Positional Argument to Keyword ConversionRejectedmatz (Yukihiro Matsumoto)Actions
Related to Ruby master - Feature #16463: Fixing *args-delegation in Ruby 2.7: ruby2_keywords semantics by default in 2.7.1Closedmatz (Yukihiro Matsumoto)Actions

Also available in: Atom PDF