Project

General

Profile

Actions

Feature #16378

closed

Support leading arguments together with ...

Added by Eregon (Benoit Daloze) about 5 years ago. Updated 3 months ago.

Status:
Closed
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 3 (0 open3 closed)

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
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0