Why can I have required parameters after a splat in Ruby but not optional ones? [duplicate]
问题 This question already has answers here : How to define a method in ruby using splat and an optional hash at the same time? [duplicate] (5 answers) Closed 5 years ago . This is possible in Ruby: class SomeClass def initialize(a, *b, c) end end but this is not: class SomeClass def initialize(a, *b, c='anything here') end end Why? Edit: This question does NOT have an answer. In the answer linked, the first answer is: The splat means "use up all of the remaining arguments" but then you provide an