From: Bil Kleb Date: 2007-01-29T08:30:10+09:00 Subject: Help DRY a couple ifs The following snippet is simply nasty, but I can't see a simple way to DRY it: if data['medium'].has_key? xyz medium = data['medium'][xyz] else $stderr.print "Warning: Did not locate point in medium mesh: " $stderr.puts xyz.join(',') next end if data['fine'].has_key? xyz fine = data['fine'][xyz] else $stderr.print "Warning: Did not locate point in fine mesh: " $stderr.puts xyz.join(',') next end I suspect my lack of eval knowledge may be the trouble, but that may be a good thing? Thanks, -- Bil Kleb http://fun3d.larc.nasa.gov