Project

General

Profile

Actions

Feature #6353

closed

caller-side **

Added by mame (Yusuke Endoh) about 10 years ago. Updated about 10 years ago.

Status:
Closed
Priority:
Normal
Target version:
[ruby-core:44591]

Description

Relating to keyword argument (#5474), there are some requests for
caller-side **. [ruby-core:40518]

def foo(k1: 1, k2: 2)
p [k1, k2]
end
h = {k2: "bar"}
foo(k1: "foo", **h) # <== here
#=> ["foo", "bar"]

Marc-Andre explained the use case [ruby-core:41772], and matz agreed with
this feature. [ruby-core:41818]

However, it conflicts with power expression when parens are omitted:

foo **h # foo(h)? or foo.send("", h)?

Which should it be interpreted?

Anyway, I have no idea to avoid yacc conflict.
Nobu, could you please try to implement it?

--
Yusuke Endoh

Actions

Also available in: Atom PDF