From: Dave Thomas Date: 2000-10-15T21:29:54+09:00 Subject: [ruby-talk:5543] Re: Some newbye question matz@zetabits.com (Yukihiro Matsumoto) writes: > 3 possible solution in my mind for the future: > > (1) local variables in the block parameters be valid only in the > surrounding block. I think Davide proposed this one. This > violates (a), and introduces incompatibility (small?). This is > not perfect since the problem remains for non parameter local > variables. If I had a vote, I'd go for this one, as it seems cleanest. Non-parameter variables are fine as they are, as they make closures possible. Parameters are different, though. A parameter is not a true variable per-se, but instead is a placeholder for one. The fact that a parameter shares a name with another variable in the enclosing scope is just a coincidence. I guess an alternative would be to make _all_ variables and parameters local to the block, and then introduce some kind of operator which says "scope this variable outside the block" so that closures would work. This has the benefit of making scope-sharing explicit, but is would break a whole heap of code. Regards Dave