From: "matz (Yukihiro Matsumoto)" Date: 2022-01-06T11:13:18+00:00 Subject: [ruby-core:106982] [Ruby master Feature#18460] implicit self for .() syntax without rvalue Issue #18460 has been updated by matz (Yukihiro Matsumoto). 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. ---------------------------------------- Feature #18460: implicit self for .() syntax without rvalue https://bugs.ruby-lang.org/issues/18460#change-95812 * Author: cvss (Kirill Vechera) * Status: Rejected * Priority: Normal ---------------------------------------- We have a nice `.()` shorthand for calling Proc ```ruby 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: ```ruby m.instance_exec { self.(2) } # 3 m.instance_exec { .(2) } # syntax error, unexpected '.' (SyntaxError) ``` So I propose to make this syntax valid too. -- https://bugs.ruby-lang.org/ Unsubscribe: