>>>>> "A" == Aredridel  <aredridel / nbtsc.org> writes:

A> Class === obj # Bad, because you can define an evil subclass.

 This is not a problem.

 1) if you use `case', you can trust the result (i.e. an object can't "lie")

 2) you know that some methods are safe. For example, if you have a String
    or an Exception use String.new(obj). If you have an Integer or a
    Bignum, use Integer(String.new(obj.to_s)). If you have a Time object
    use Time.at(obj), etc

    Now, if you have a container (Array, Hash, ...) just create a new
    container and store it only "safe" objects.


Guy Decoux