Project

General

Profile

Actions

Bug #8457

closed

Function arguments: Is this intended?

Added by Anonymous about 12 years ago. Updated about 12 years ago.

Status:
Closed
Target version:
-
ruby -v:
2.0.0
[ruby-core:55185]

Description

a = [1, 2, x: 3]
a.tap { |*p, q| a.clear.concat p } #=> [1, 2]

but

a = [1, 2, x: 3]
a.tap { |*p, **q| a.clear.concat p } #=> [[...]]

and also

a = [1, 2]
a.tap { |*p| a.clear.concat p } #=> [[...]]

???

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0