From: "cvss (Kirill Vechera)" Date: 2022-01-05T14:51:23+00:00 Subject: [ruby-core:106973] [Ruby master Feature#18460] implicit self for .() syntax without rvalue Issue #18460 has been reported by cvss (Kirill Vechera). ---------------------------------------- Feature #18460: implicit self for .() syntax without rvalue https://bugs.ruby-lang.org/issues/18460 * Author: cvss (Kirill Vechera) * Status: Open * 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: