From: "David A. Black" Date: 2007-10-15T01:50:33+09:00 Subject: Re: Parameter in a block is not local? On Mon, 15 Oct 2007, David A. Black wrote: > a is local, not global. The semantics of block parameters is > assignment semantics: > > |a| > > basically means "a = ...", in the same scope as the scope in which the > block is created. I should amend that by noting that it's a "one-way valve": if the variable exists before the block is created, the scope is flat, whereas if the variable doesn't exist yet, it also doesn't exist when the block exits. In other words, the local scope enters the block, from the left, so to speak, bringing all its bindings with it; and it exits from the right with only those bindings, which may or may not have been altered during their time in the block. David -- Upcoming training from Ruby Power and Light, LLC: * Intro to Ruby on Rails, Edison, NJ, October 23-26 * Advancing with Rails, Edison, NJ, November 6-9 Both taught by David A. Black. See http://www.rubypal.com for more info!