Project

General

Profile

Actions

Feature #16045

closed

Calling functions with keyword arguments

Added by D1mon (Dim F) over 5 years ago. Updated over 5 years ago.

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

Description

Python:

def fn(a=1,b=2,c=3):
    print(a,b,c)

fn() # 1 2 3
fn(c=4) # 1 2 4

Ruby:

def fn(a=1, b=2, c=3)
  p a,b,c  
end

fn(c=4) # 4 2 3

A very convenient and necessary thing that you must add in Ruby!?

Actions

Also available in: Atom PDF

Like0
Like0Like0