ruby picture

RCR 316: arguments after a splat in a method call

Submitted by eric_mahurin (Sun Sep 11 18:55:46 UTC 2005)


The restriction that no arguments or splats follow a splat when calling a method should be removed. The same can be said of the multiple-assign RHS.


Many times, you'll want to splat some array in an argument list into its components. This need may or may not correlate to where a splatted (or maybe unsplatted?) argument is in the method definition. Currently, if you want to do something like this:


you have to do this:



A calling argument list or RHS of a multiple-assign like this:

a, *b, c, d, *e, f

should be equivalent to:


Basically, form an array by concatenating arguments as elements (not splatted) or as arrays (splatted). Then splat the whole thing as the argument list.


The current limitation that no arguments are allowed after a splatted argument within an argument list seems quite arbitrary.

No backwards incompatibilities.

I just found that this legacy RCR is almost identical:


A parser change and more continuity in how calling argument lists (and MRHS) are handled.
ruby picture
Comments Current voting
Accepted. You will see this in Ruby2.


Strongly opposed 0
Opposed 0
Neutral 0
In favor 1
Strongly advocate 1
ruby picture
If you have registered at RCRchive, you may now sign in below. If you have not registered, you may sign up for a username and password. Registering enables you to submit new RCRs, and vote and leave comments on existing RCRs.
Your username:
Your password:

ruby picture

Powered by .