From: Paul Brannan Date: 2001-10-27T04:10:02+09:00 Subject: [ruby-talk:23493] Re: Issues with white space [was Re: Bruce Eckel's opinion of Ruby] On Sat, 27 Oct 2001, Pixel wrote: > I think the easiest way to catch this is to warn for unused constants alike > C's compiler: > > % echo 'int main() { 1 ; return 0; }' > /tmp/t.c && gcc -Wall /tmp/t.c > /tmp/t.c:1: warning: statement with no effect This is not as easy as it sounds: 1 + 1 # statement has no effect class Fixnum alias_method :plus, :+ def +(other) $foo = other plus(other) end end 1 + 1 # statement has a side-effect p $foo # this should print 1 Perhaps you may argue that this is a bad idea in the first place, and maybe it is. My point, though, is that anything in Ruby can have a side-effect, so while a warning might be useful to one person, it might disgust someone else. Perhaps Ruby should have different warning levels? Paul