From: Ryan Davis Date: 2007-12-23T09:39:53+09:00 Subject: Re: Block-local variables - obsolete? On Dec 22, 2007, at 15:32 , murphy wrote: > Charles Oliver Nutter wrote: >> Only block parameters are now always local to the block; variables >> from >> enclosing scopes are still visible. The ; syntax, then, is to specify >> certain names should be forced local, rather than defering to the >> outer >> scope. > is this really the difference? both produce the "shadowing outer local > variable" warning: I _think_ what Charles was getting at is by forcing local you can't use the variable AFTER the block: > irb(main):004:0> (1..2).each do |n; m| m ||= 0; m += n; end > => 1..2 > irb(main):005:0> m > NameError: undefined local variable or method `m' for main:Object (but, that appears to be the case regardless of the semicolon)