From: Massimiliano Mirra Date: 2002-10-06T22:11:14+09:00 Subject: Re: Specifying local and external block parameters (that old chestnut) On Sun, Oct 06, 2002 at 09:19:25AM +0900, Nikodemus Siivola wrote: > The current behaviour may cause newcomers some surpirises, May I ask, surprises to whom? Java doesn't let you do this at all: int foo = 3; if (true) { int foo = 4; Maybe C++ folks? > but is it really wrong? I don't recall ever having considered it wrong or being surprised by it. I always use it explicitly when a variable's value depends on an analysis done inside an iterator: txt_file = nil files.each do |file| if file =~ /.txt$/ txt_file = file break end end txt_file >> "foo.txt" # Yes I know about Enumerable#find ;-) Massimiliano (bard on IRC)