Why is this splat method call not working in Ruby?

Viewed 317
def method(a, b='a', c, *d)
  [a,b,c, d]
end

p method(1,2,3,4)

doesn't work, I don't understand why, if we remove the b parameter all works well. The syntax rules say that you can put params with default values before the splat parameter.

3 Answers
Related