From: Aaron Patterson Date: 2012-02-25T03:19:19+09:00 Subject: [ruby-core:42861] Re: [ruby-trunk - Feature #6070] The scope of for loop variables --CUfgB8w4ZwR/yMy5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 24, 2012 at 02:25:57PM +0900, Shugo Maeda wrote: >=20 > Issue #6070 has been updated by Shugo Maeda. >=20 > File for_loop_scope_fix_2.diff added >=20 > Hi, >=20 > Shugo Maeda wrote: > > There is at least one problem in this patch. The problem is that it ca= nnot handle > > the following code in mkmf.rb. >=20 > I've fixed my patch to fix the problem. > By the attached patch, the scope of variables in expr_value is not limite= d in > the for expression. >=20 > I think it's reasonable because >=20 > for i in > end >=20 > is equivalent to >=20 > .each do |i| > end >=20 > , where is outside the block. I agree with your opinion regarding the current side effect problems of `for`. I would love to see your patch in Ruby 2.0! --=20 Aaron Patterson http://tenderlovemaking.com/ --CUfgB8w4ZwR/yMy5 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (Darwin) iQEcBAEBAgAGBQJPR9SeAAoJEJUxcLy0/6/GQGIIAIVSCd0PGbV8OlUnJpchda9s 9TDI24fKtReVOcFGmVahFP2nTZaejTl0Q5IoDHYjZ4JAQK5St0/gscBuIIaqoU0X 5dsQR98fGfdXJQmJlE2z9lPBsimexJYlmCla6y+29h+c6hQXu+LL+NSrbM+z1kH5 URm+7eFElhCW2angvjfPcOMddMwPQ9wsLOlwdt+K5Xa6UDzfeMIXG/Rwq92KePkP GZi7GU+UhjpoVxaleeNRQ20ktuff4jpaUXDKxBWP/01jRlwaI7UcmCVXKG4kNZGL zxWt2kYftdkjyq6kGPvH2ty8UvIq6OVDzGu1jomvRBaBOMTccPO4vlAI5+4vQZo= =sjWy -----END PGP SIGNATURE----- --CUfgB8w4ZwR/yMy5--