From: Peter Hickman Date: 2001-11-30T23:45:23+09:00 Subject: [ruby-talk:27071] Re: Using Enumerable Mike Stok wrote: > Be careful that the use of an instance variable means that you may be > surprised by the behaviour of code like > > fred = Fred.new > > fred.each { |f1| > puts "f1 is #{f1}" > fred.each { |f2| > puts "f2 is #{f2}" > } > } > > as the two iterators "share" @pointer and don't play well together. Fortunately for this class I have a very specific use in mind and I can avoid this headache altogether.