From: robin Date: 2007-01-28T09:05:08+09:00 Subject: Re: Question about variable scope On Jan 27, 6:24 pm, Thomas Hafner wrote: > I'll try. Everytime the block is executed, new variables n, i and j > are created, because they don't already exist outside the block. If > you want i to be shared, it should already exist before, e.g.: > > i = nil > 2.times{|n| i,j = n,i; puts "i=#{i}, j=#{j.inspect}"} Thanks for the reply. I think I've succeeded in adjusting my mental model enough that this now makes sense. :-) Robin