Project

General

Profile

Actions

Bug #18267

closed

Argument forwarding requires parenthesis on method definitions

Added by tenderlovemaking (Aaron Patterson) about 3 years ago. Updated about 3 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.1.0dev (2021-10-21T22:47:38Z master 844588f915) [x86_64-darwin20]
[ruby-core:105795]

Description

I like to write my method definitions without parenthesis. For example:

def foo bar
  # ...
end

I tried to use ..., but it doesn't work. For example if I do:

def call a, ...
  a.nil?(...)
end

It will be a syntax error, and the program exits. Can we make this syntax work so that I can always omit parenthesis?

Thank you!

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0