From: Ryan Davis Date: 2013-01-24T12:03:37+09:00 Subject: Re: order of parameters and arguments On Jan 23, 2013, at 18:12 , Patricia J. wrote: > Can someone pls explain why in the following example that *c is left > empty? After the required arguments have been filled, doesn't it make > more sense that since b=1 has already been assigned a value to give the > remaining value/argument (2) to *c? > > Can you pls confirm that arguments with default values are always paired > before sponge arguments (*c)? > > > . . . . > > def args_unleashed(a, b=1, *c, d, e) > puts "Arguments: " > p a, b, c, d, e > end > > args_unleashed(1, 2, 3, 4) > > => [1, 2, [], 3, 4] so... let's take the trailing args out and re-consider: def f(a, b=1, *c); end f(1, 2) You think that the 2nd arg should be in c as well? If so, how do you get any other value into b, ever?