From: "Radosław Bułat" Date: 2008-12-06T23:53:50+09:00 Subject: [ruby-core:20400] More powerful method arguments (I'm thinking very loudly, don't get it to seriously) I was thinking about "mandatory arguments after optional" in 1.9 lately and I cannot think about real use case with it but... if we can do this def foo(*args, options = {}) end then we could use optional argument "options" like named arguments list (which could be empty). foo(1, 2, 3) foo(1, 2, 3, controller: "foo", action: "bar") It's almost the same as: def foo(*args, options) end But in this case "options" isn't optional, and we must pass explicitly empty hash {}. foo(1, 2, 3, {}) It's very common idiom in Ruby to do that: def foo(*args) options = args.last.is_a?(Hash) ? args.pop : {} # ... end $ pwd /usr/lib/ruby/gems/1.8/gems $ gem list | wc -l 275 $ grep -ER ".(last|\[-1\]).(is_a|kind_of|instance_of)\?[( ]Hash" . | wc -l 258 The point is that we can even make even more powerful (and complicated) method arguments with allowing to place *args in any place ;-). def foo(*rest, a, b = 1, c, &block) end I think it shouldn't make method invocations ambiguous. -- Radoslaw Bulat