Project

General

Profile

Bug #12522

Updated by nobu (Nobuyoshi Nakada) over 8 years ago

I propose that it is more intuitive (and much better for FREST functions; see #12521) if explicit keyword arguments supercede the double-splat argument, rather than the opposite as it is now. 

 This: 

 ```ruby ``` 
 def foo(x:) 
   p "Foo x: #{x}" 
 end 

 foo x: 1, **{x: 'fallback'} 
 ``` 

 should not print 'fallback'. 

 I believe that it is more intuitive for the explicit x to supercede the one in the double splat. 

 Ruby 2 has an amazing and under-utilized ability to sling around, pull apart and combine hashes just in the process of calling functions. I've been exploring where this can take us recently, and #12512 and this would both significantly improve the usefulness and intuitiveness of this language feature. 

 If we wish to retain the current behavior for compatibility or whatever, then I propose a triple splat or double-colon keyword symmetric with #12512.

Back