From: Navindra Umanee Date: 2005-02-01T01:41:43+09:00 Subject: Re: Ten Things Every Java Programmer Should Know About Ruby Florian Frank wrote: > The only difference is that the interpreter/compiler can infer the types > during compile time, and doesn't wait until run time like Ruby. The difference is that ML has a strict mathematical definition for what type means. The definition is inductive. From that definition it is clear that data is strongly typed... a piece of data has a precise well-defined type, even if functions can have a polymorphic type. What is the definition of type in Ruby? I'm going by duck typing. An object is a duck if... Same object is also a pig if... Essentially we're inventing types as and when we need them. It's completely arbitrary, but it works if you can wrap your head around the concept. If despite Ruby's lack of a rigid definition for a type, you still want to claim that an object is strongly typed, you might say the object is of imaginary type SuperMegaPigDuck -- but you will have to qualify that with a "at a certain point in time" statement. Because an object's type can change from time to time simply by dynamically modifying the object. Your SuperMegaPigDuck object might become CantDoNothing with a few changes. In Ruby, the type of an object is fuzzy. I like it. Cheers, Navin.