Project

General

Profile

Actions

Feature #7346

closed

object(...) as syntax sugar for object.call(...)

Added by rosenfeld (Rodrigo Rosenfeld Rosas) over 11 years ago. Updated over 11 years ago.

Status:
Rejected
Target version:
[ruby-core:49298]

Description

I propose for the parser to interpret "object(...)" as "object.call(...)". It should raise NoMethodError at runtime if object doesn't respond to "call".

This would read better than using "call":

double = -> n { n * 2 }

double(3) == 6

Sorry if this has already been proposed before (and rejected) but I couldn't find any references to something like this using Redmine's search interface.


Related issues 1 (0 open1 closed)

Has duplicate Ruby master - Feature #6672: Calling #() without dot before bracesRejected06/30/2012Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0