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. -- marko schulz Dieser Satz beinhalten drei Fehller.