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.
>
> Some of the more fair-minded critiques of Ruby that I've seen could be
> construed as saying that "Ruby is an easy language, except ..., but ...,
> and so on." This is a chance to remove one of those "excepts" and "buts".
>
> 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.

I certainly agree that this should not be warned about under -w.  In
fact...  I'm not sure what the warning would be.  I can't help
thinking that to a large extent this case would be mostly covered by
#5, above.  (Obviously I don't mean *you* :-)

The way Matz has designed it (and assuming I understand it), the arg2
in "ary.each do |arg2| ... end" has the same status as the arg2 in
"arg2 = 100".  Some of the discussion around this idiom has seemed to
take the tone that |arg2| "shouldn't" have that status.  I happen not
to agree with that (i.e., I find the construct clear).  But however
one feels, given the fact that it's a perfectly consistent construct,
it's hard to imagine a warning that wasn't actually critical of the
design of the language -- because what else is there to say?  Which is
where my preference for #5 comes in :-)


David

-- 
David Alan Black
home: dblack / candle.superlink.net
work: blackdav / shu.edu
Web:  http://pirate.shu.edu/~blackdav