Yukihiro Matsumoto <matz / ruby-lang.org> wrote: > |Okay, so object.class will supposedly tell you what class an object > |is... but you can override that method and nobody really cares. So > |Ruby doesn't guarantee anything about type safety. > > Define "type safety" here. I consider it as that every type error can > be found (at run time), and no fatal error (e.g. segmentation fault) > can be caused by type mismatch. > > What is yours? Ability to tell an object's class? Inability to > change the class of an object at run time? Thinking about it, I think my problem is that I didn't have a proper concept of what a type is in Ruby. However, if I revert back to duck typing as a concept, I finally get a definition: In Ruby, an object is of type Duck if: (1) The object walks like a duck. (2) The object quacks like a duck. Since Ruby always makes sure an object is of type Duck if it needs a duck, Ruby is type safe. Duck typing is a loose concept however as shown in the previous discussions (an object can be an arbitrary number of types and/or types overlap), and I am not sure if you can call such a thing strong typing although Ruby is type safe within the definition of duck typing. Cheers, Navin.