Actions
Feature #18460
closedimplicit self for .() syntax without rvalue
Status:
Rejected
Assignee:
-
Target version:
-
Description
We have a nice .()
shorthand for calling Proc
m = 1.method(:+)
m.(2) # 3
But while we can use this shorthand in a Proc's context with the explicit self, we cannot use it with the implicit self:
m.instance_exec { self.(2) } # 3
m.instance_exec { .(2) } # syntax error, unexpected '.' (SyntaxError)
So I propose to make this syntax valid too.
Updated by matz (Yukihiro Matsumoto) almost 3 years ago
- Status changed from Open to Rejected
This proposal is rejected for several reasons:
- we don't allow
.m
notation for implicit self (for now at least) - You will gain only 4 fewer characters
- I don't think it's worth the cost of syntax complexity it brings
Matz.
Actions
Like0
Like0