From: Asim Jalis Date: 2004-04-03T09:35:56+09:00 Subject: Re: Learning Ruby, was a C geek... On Sat, Apr 03, 2004 at 09:19:19AM +0900, Chris Dutton wrote: > A few suggestions, if I may. > > I wonder if your option detection might be more efficient as: > > trace = true if ARGV.include? "-t" > dump = true if ARGV.include? "-d" > filenames = ARGV.delete_if { |n| n !~ /^[^-]/ } > fn = filenames.empty? ? nil : filenames.first > > It would save you from looping through ARGV, just in case it's > a mile long or something. :-) Another suggestion would be to remove the trace statements, which clutter up the code. Instead use unit tests to ensure correctness. Asim