From: Jim Deville Date: 2008-11-13T04:33:07+09:00 Subject: [ruby-core:19893] Re: Proposal: Method#get_args > -----Original Message----- > From: Jim Weirich [mailto:jim.weirich@gmail.com] > Sent: Wednesday, November 12, 2008 11:23 AM > To: ruby-core@ruby-lang.org > Subject: [ruby-core:19892] Re: Proposal: Method#get_args > > > On Nov 12, 2008, at 1:46 PM, Charles Oliver Nutter wrote: > > > At that point I think we gain very little over arrays of arrays, > > since we have to walk Parameters of Parameter(s) in almost exactly > > the same way... > > Not much difference in the walking, but: > > (1) I can ask parameter.required? rather than parameter.first > == :req. Seems a win to me. > > (2) You could put a special to_s method on Parameters that formats the > parameter list intelligently. (e.g. parameters.to_s => "(a, b = 1, > *c, d)" ) > > -- > -- Jim Weirich > -- jim.weirich@gmail.com > > It could also behave like an array with Enumerable, each and :[] defined. It should still be light weight, just cleaner to query.