> OTOH, I would expect a warning for _this_ code:
> 
>   i = 0
>   [1,2,3].each { |i|
>     i = 7
>   }
>   puts i 

That's something I've been meaning to ask for: please can ruby -w generate a
warning (at compile time) if a local variable is assigned to one or more
times, but its value is never used.

At very least, this will catch some typos in assignment statements, and it
may catch some cases where you meant to use an attribute writer, but forgot
to prefix the assignment with 'self.'

This is one thing which perl -w handles rather well: it catches many of my
stupid typos before the code even starts running, which is especially useful
for those lines of code which are very rarely executed, such as error
handlers. It's unfortunate that Ruby can't do most of this checking, because
of the local variable / self.method ambiguity.

Thanks...

Brian.