Project

General

Profile

Feature #15632

Dynamic method references

Added by kddeisz (Kevin Deisz) 18 days ago. Updated about 21 hours ago.

Status:
Feedback
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:91652]

Description

In Ruby 2.7 we have the new .: method reference operator, which is so great!

I was hoping to be able to use this operator dynamically (which you currently have to fall back to the method method). What I'm proposing is

foo.:"bar_#{baz}"

which is basically the equivalent of dyna symbols.

History

Updated by shevegen (Robert A. Heiler) 18 days ago

I am biased so I will not comment on the suggestion itself, but
I have one question (possibly I may not be the only one):

What are dyna symbols?

Updated by k0kubun (Takashi Kokubun) 17 days ago

  • Status changed from Open to Feedback

To get your proposal accepted, we always need to have a real-world use case. Just showing a project that calls Object#method with a dynamic method name might be sufficient to make us understand why it's helpful.

Updated by nobu (Nobuyoshi Nakada) 16 days ago

IIRC, it was rejected (or suspended at least) by matz at the previous developers' meeting.

Updated by kddeisz (Kevin Deisz) about 21 hours ago

Okay, in that case this can be closed.

Also available in: Atom PDF