From: Brian Candler Date: 2008-11-14T17:47:43+09:00 Subject: [ruby-core:19933] Re: {Proc,Method}#parameters (Re: Proposal: Method#get_args) On Fri, Nov 14, 2008 at 03:30:44PM +0900, Charles Oliver Nutter wrote: > The original proposal also asked for literal defaults to be present. True - but it's not clear if, or how, the literal defaults are used in merb. Since "=" is not a valid character in a local variable, you could have a string-based API which accommodates defaults: def action(a, b, c=123, d="hello #{c}", *e) => ["a", "b", "c=123", "d=\"hello #{c}\"", "e=*"] But if this information is more expensive to collect and to split out, and doesn't have a defined purpose, then I think it should be excluded. I don't think anyone's proposing this is an interface to be used by rdoc or other tools which need a full parse. In Merb's case, it's so that an incoming parameters hash of {:a => "foo", :b => "bar", :x => "ignoreme"} can be passed to the action() method in the correct positions. It's a poor-man's named arguments.