Marko Schulz wrote: # On Fri, May 04, 2001 at 08:51:32AM +0900, David Alan Black wrote: # > On Fri, 4 May 2001, Conrad Schneiker wrote: # > # > > # On Thu, 3 May 2001, Wayne Scott wrote: # > > # # > > # > #simplified for this discussion # > > # > def fetch(arg2) # > # > [snip] # > # > > # > @cache.dup.each do |arg2, file| ## (1) # > # > [snip] # > # > > # I don't know if the behavior should change but I think it should at # > > # least issue a warning if there is reuse like this. # > > # > > I think this is an important suggestion. # > > # > > Answers such as: # > > # > > 1) I should have known better. # > > 2) You should have known better. # > > 3) Here is a way around this. # > > 4) There is (or soon will be) a better feature to use. # > > 5) Once you know Ruby better, this won't be a problem for you. # > > # > > are all true to some degree, but are somewhat beside the point of accident # > > prevention in the cases that people are caught unawares. # > # > I certainly agree that this should not be warned about under -w. # # I certainly do not agree with you. This should be warned about under -w. # # > In fact... I'm not sure what the warning would be. # # Something like 'Warning. Use of local variables as block parameters # may lead to unexpected side effects.'? # # > I can't help thinking that to a large extent this case would be # > mostly covered by #5, above. # # I do not agree with you here either. Of course this errors get if you # have accumulated experience and write new code. But when you start to # refactor without a tool to aid you, this bites you fast. Well, I kind of agree with all of you. But I kind of also agree with myself too. :-) That's why I initially made the following suggestion that everyone seems to have overlooked: # Maybe a "last resort" "extra cautious" warning level is needed to deal # with things such as this, so that people can habitually run with -w # without being overwhelmed with false alarms about issues they know about # or have otherwise dealt with. Just so there is no misunderstanding, this would be *another* (for example, -ww or -w2 or -w9) option that gave you the current and *unmodified* -w warnings, *plus* things that are known to be *sometimes* troublesome for the new non-expert Ruby fans, people who missed their morning coffee break, the sleep-deprived, the rushed maintainers of other people's code, and so on. Conrad Schneiker (This note is unofficial and subject to improvement without notice.)