Actions
Feature #12129
opensyntactic sugar for dynamic method dispatch `object_expression:method_name_expression(1, 2)`
Status:
Open
Assignee:
-
Target version:
-
Actions
Like0
Like0Like0Like0
Added by bughit (bug hit) almost 9 years ago. Updated almost 9 years ago.
Describe more concretely and preferably tell us why do you need it, please.
Matz.
Yukihiro Matsumoto wrote:
Describe more concretely and preferably tell us why do you need it, please.
object_expression:method_name_expression(1, 2)
would be sugar for
object_expression.__send__(method_name_expression, arg1, arg2)
like any sugar, you can live without it, but I think a dynamic language should have it.
e.g. in javascript: object_expression[method_name_expression](arg1, arg2)
bug hit wrote:
Yukihiro Matsumoto wrote:
Describe more concretely and preferably tell us why do you need it, please.
object_expression:method_name_expression(1, 2)
would be sugar for
object_expression.__send__(method_name_expression, arg1, arg2)
Please, for the love of all that is holy, regardless of whatever syntax sugar you choose, make it translate or equivalent to public_send
, not __send__
!