From: "James F.Hranicky" Date: 2002-10-04T20:08:41+09:00 Subject: Re: Specifying local and external block parameters (that old chestnut) On Fri, 4 Oct 2002 18:54:45 +0900 Nikodemus Siivola wrote: > a and c are local > ::b and ::c refer to the enclosing environment. > > array.each {|a, ::b| > c = a + ::b > ::d = a - ::b > } I proposed this a while back, too. In this case, though, you wouldn't need to specify "::b" within the block, as it was declared external to the block in the paramter list, right: array.each {|a, ::b| c = a + b ::d = a - b } That is, unless this fall into the same category as "__var" , where we have to specify scope at compile time (why "attr_private" won't work). ---------------------------------------------------------------------- | Jim Hranicky, Senior SysAdmin UF/CISE Department | | E314D CSE Building Phone (352) 392-1499 | | jfh@cise.ufl.edu http://www.cise.ufl.edu/~jfh | ---------------------------------------------------------------------- "Given a choice between a complex, difficult-to-understand, disconcerting explanation and a simplistic, comforting one, many prefer simplistic comfort if it's remotely plausible, especially if it involves blaming someone else for their problems." -- Bob Lewis, _Infoworld_