"Gray, Jeff" wrote:
> Could someone suggest a way to rewrite "inc_iv" without using eval, without
> turning the guts of the each block into a method, and without flattening the
> [:@a, :@b].each{} construct?

If I'm allowed to make accessors methods for the variables, (albeit
private if you want to), then here is what I tend to do (probably way to
much):
<CODE>
class Foo2
  private
  attr_accessor :a, :b
  
  public  
  def initialize
    @a = 1
    @b = 2
  end

  def inc_iv
    [:a, :b].each { |iv|
      send("#{iv}=", send("#{iv}") + 1)
    }
  end
end
</CODE>


-- 
(\[ Kent Dahl ]/)_    _~_    __[ http://www.stud.ntnu.no/~kentda/ ]___/~
 ))\_student_/((  \__d L b__/  NTNU - graduate engineering - 4. year  )
( \__\_?|?_/__/ ) _)Industrial economics and technological management(
 \____/_?_\____/ (____engineering.discipline_=_Computer::Technology___)