title: Ruby - Mixing named and positional parameters, why does order matter?
body: <p>Creating a function with both named and positional parameters</p>
  
  <pre><code>class Foo
    def initialize(bar:, bang:, bamph, &amp;block)
      # ...
    end
  end
  </code></pre>
  
  <p>Produces a syntax error:</p>
  
  <pre><code>$ ruby -c scratch.rb
  scratch.rb:2: syntax error, unexpected tIDENTIFIER
  ...f initialize(bar:, bang:, bamph, &amp;block)
  ...                          ^~~~~
  </code></pre>
  
  <p>Wheras this</p>
  
  <pre><code> def initialize(bamph, bar:, bang:,  &amp;block)
      # ...
   end
  </code></pre>
  
  <p>does not.</p>
  
  <p>As far as I can see, <a href="https://stackoverflow.com/a/20633975/1596460">this answer</a> explains that the ordering of the parameter type must follow a specific pattern.   But what benefit is gained by enforcing this hierarchy?</p>