Project

General

Profile

Actions

Feature #18460

closed

implicit self for .() syntax without rvalue

Added by cvss (Kirill Vechera) over 2 years ago. Updated over 2 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
[ruby-core:106973]

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.

Actions

Also available in: Atom PDF

Like0
Like0