From: Tim Hunter Date: 2007-06-24T06:35:25+09:00 Subject: Re: Named/positional method args darren kirby wrote: >> def write_picture(outfile = nil, n = 1) >> > > Is there a clean way to accomplish my goal? Are there plans to give named > arguments to Ruby in the future? > The standard technique for doing this is to use a hash with symbols for the argument names. Remember Ruby collects up trailing hash assignments into a single hash, so you could do something like this; write_picture(:outfile=>whatever, :n=>1) Your method is defined like this: def write_picture(args) outfile = args[:outfile] n = args[:n] ... end And, yes, I believe the current plan is to have named arguments in a future release of Ruby. -- RMagick OS X Installer [http://rubyforge.org/projects/rmagick/] RMagick Hints & Tips [http://rubyforge.org/forum/forum.php?forum_id=1618] RMagick Installation FAQ [http://rmagick.rubyforge.org/install-faq.html]