From: ara.t.howard@... Date: 2006-12-01T00:06:11+09:00 Subject: Re: Wrong results using named arguments On Thu, 30 Nov 2006, Ryan Williams wrote: > In most cases I think it is best if you define DEFAULTS inline, as in: > > def m opts = {} > opts = {:x => 1, > :y => 2}.merge(opts) > p opts > end > > That way it's closer to the call and thus more self-documenting, and you > don't have to worry about naming a bunch of constants in your class. The > downside is you're newing up a new defaults hash in every method call, and > executing any contained statements. if you like that style you may like this lib http://codeforpeople.com/lib/ruby/parseargs/parseargs-0.3.0/README http://rubyforge.org/frs/?group_id=1024&release_id=8211 regards. -a -- if you want others to be happy, practice compassion. if you want to be happy, practice compassion. -- the dalai lama