From: matz@... (Yukihiro Matsumoto) Date: 2003-01-30T02:50:00+09:00 Subject: Re: Local variables & blocks Hi, In message "Re: Local variables & blocks" on 03/01/30, ahoward writes: |> I may drop ':=' part, i.e. |> |> * block parameters are local to the block |> * shadowing cause warnings |> * no other way to make block local variables | |so, correct me if i am wrong, but this does not address the need to do | | x = nil | a.each do |item| | x = ... | end | p x | |does it? It does. The key is: * no other way to make block local variables So that x in a.each do |item| x = ... end p x would not be a block local variable. The code above will work without preceding "nil" assignment. matz.