From: ts Date: 2000-10-15T21:45:24+09:00 Subject: [ruby-talk:5545] Re: Some newbye question >>>>> "D" == Dave Thomas writes: D> 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. D> If I had a vote, I'd go for this one, as it seems cleanest. OK, but how many script do you break ? For example in test.rb tt{|i| break if i == 5} test_ok(i == 5) Why not something like 'let', with this pseudo-syntax (this is just an example not a proposition) dvar(a, b) # a and b are forced to be dynamic variable in the block # even if it exist a local variable a # do what you want end but unfortunately I can't make this work :-( a = 24 # local variable dvar(a, b) a = b = 12 # dynamic variable dvar(b) b = 24 end b # here b has the value 24 when I want 12 :-( :-( end a # local variable Guy Decoux