From: matz@... Date: 2017-12-12T08:40:03+00:00 Subject: [ruby-core:84194] [Ruby trunk Feature#4288][Closed] Allow invoking arbitrary method names with foo."something" syntax Issue #4288 has been updated by matz (Yukihiro Matsumoto). Status changed from Assigned to Closed I thought I have closed this issue long ago. Use `send`. Matz. ---------------------------------------- Feature #4288: Allow invoking arbitrary method names with foo."something" syntax https://bugs.ruby-lang.org/issues/4288#change-68308 * Author: headius (Charles Nutter) * Status: Closed * Priority: Normal * Assignee: matz (Yukihiro Matsumoto) * Target version: Next Major ---------------------------------------- =begin This is one Groovy feature I tend to like. For non-standard or arbitrary method names, it would be nice to have a way to invoke them directly that doesn't require the parser to be made more complex nor require an intermediate "send" call. Groovy does this by allowing the following form: foo."asdf"() This syntax would make it easier to integrate with other languages that have different naming rules. For example, =!@+= is a valid operator in Scala. With this syntax, you could invoke it as foo."=!@+=" bar The alternative in JRuby is that we have to map such names as eq_bang_at_plus_eq, which is certainly not as elegant, or force people to use send (and force them to use :"" anyway, since :=!@+= is not a valid symbol). It's left up for debate whether string interpolation should be allowed in this syntax. =end -- https://bugs.ruby-lang.org/ Unsubscribe: