From: Mike Gold Date: 2008-10-01T00:02:37+09:00 Subject: Re: ruby1.9 block scope Daniel DeLorme wrote: > David A. Black wrote: >> before you could begin to understand any of it. And you would have to >> do that for *every* block, just in case, even if only 1% of them had a >> variable defined later. > > You dont need a two-pass visual scan; it just allows you to assume that > a variable defined a line L of a method will be available for reference > at line L+n, no matter if it was defined inside a block or not. It > should be common sense, really. You have described exactly what D. Black and I mean by a two-pass scan. Line L is dependent on code arbitrarily far ahead at L+n. When you encounter the variable at line L+n, you should backtrack to line L to determine whether or not the block scopes are aligned in such a way to change the meaning of line L. -- Posted via http://www.ruby-forum.com/.