From: ts Date: 2004-09-04T20:30:00+09:00 Subject: Re: Not just $SAFE, but damn $SAFE >>>>> "A" == Aredridel writes: A> On Fri, 2004-09-03 at 17:08 +0900, ts wrote: >> 1) if you use `case', you can trust the result (i.e. an object can't "lie") A> Except that by using case, I can have an EvilString < String, for which A> that returns true. We really don't use the same ruby svg% cat b.rb #!/usr/bin/ruby class EvilString < String end obj = EvilString.new("hello") res = case obj when String String.new(obj) else raise "EvilString" end p res svg% svg% b.rb "hello" svg% `case' will call Module#===, try to modify it with $SAFE >= 4 Guy Decoux