From: "David A. Black" Date: 2007-09-26T01:32:11+09:00 Subject: Re: Why dynamic languages for ActiveRecord..? Hi -- On Wed, 26 Sep 2007, Phlip wrote: > David A. Black wrote: > >> I'd say that the type of a Ruby object can change, but its class >> cannot. That's based on an understanding of the object's type as a >> kind of runtime snapshot of what the object can do and what messages >> it understands. > > The inspiration there is Smalltalk, which is similarly strongly typed. That's the proximate inspiration, though I always remember Matz summing it up at RubyConf 2002 (I think): "Ruby is dynamic, like human nature." :-) > One common confusion among newbs is that weak typing == dynamic typing. In the long run, the notion of type in Ruby is tautological: an object is of type "The type which is the type of objects that are of this object's type." That may be why "type" sometimes gravitates toward being a synonym for "class" (along with the historical accident of Kernel#type), though I think having a separate term for the changable part is useful, and also makes sense of phrases like "duck typing". David -- Upcoming training from Ruby Power and Light, LLC: * Intro to Ruby on Rails, Edison, NJ, October 23-26 * Advancing with Rails, Edison, NJ, November 6-9 Both taught by David A. Black. See http://www.rubypal.com for more info!