From: "mame (Yusuke Endoh)" Date: 2012-11-09T18:03:08+09:00 Subject: [ruby-core:49147] [ruby-trunk - Feature #4288] Allow invoking arbitrary method names with foo."something" syntax Issue #4288 has been updated by mame (Yusuke Endoh). Description updated Target version set to Next Major ---------------------------------------- Feature #4288: Allow invoking arbitrary method names with foo."something" syntax https://bugs.ruby-lang.org/issues/4288#change-32693 Author: headius (Charles Nutter) Status: Assigned Priority: Normal Assignee: matz (Yukihiro Matsumoto) Category: 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 -- http://bugs.ruby-lang.org/