Project

General

Profile

Actions

Feature #16605

closed

Support argument delegation (...) with blocks/define_method

Added by svoop (Sven Schwyn) about 4 years ago. Updated about 4 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
[ruby-core:97050]

Description

(I couldn't find anything on this in the bug tracker or other official sources, hope it's not a duplicate since it's kind of tricky to search for it.)

The following doesn't work on Ruby 2.7:

define_method(:delegate) do |...|    # <-- syntax error
  target(...)
end

Are there any plans to support argument delegation in block arguments?

Updated by shevegen (Robert A. Heiler) about 4 years ago

It may be that this is a new suggestion, at the least I don't recall a similar proposal
although perhaps others thought about it before, since it may make sense (e. g. if
you wish to dynamically add methods).

Updated by matz (Yukihiro Matsumoto) about 4 years ago

  • Status changed from Open to Rejected

You may think it's handy. But it's far more complicated than you think. For example, define_method may be called from a method with argument forwarding. At least for the moment, it does not worth the cost of implementation/complexity.

Matz.

Actions

Also available in: Atom PDF

Like0
Like0Like0