From: dblack@... Date: 2003-03-24T23:06:23+09:00 Subject: Re: Types (was Re: Ruby lecture slides (was Strong advantages over Python)) Hi -- On Mon, 24 Mar 2003, Jim Freeze wrote: > On Monday, 24 March 2003 at 16:33:35 +0900, Dave Thomas wrote: > > > > Take this example: > > > > class Fred > > def shout > > puts "wilma" > > end > > end > > > > f = Fred.new > > > > o = Object.new > > def o.shout > > puts "wilma" > > end > > > > 'f' and 'o' have different classes (Fred and Object respectively) but > > they have indistinguishable types (for all intents and purposes). In > > Thanks for the fine example, but for those of us who are a little slow, > what exactly are the types of 'f' and 'o'? My characterization of those types, if I had to provide one, would be something like: respondent to "shout". Of course that kind of circular description doesn't scale well in the face of a more extensive set of methods, which I think is one reason why the idea of type is inadequate to the task of telling us much about Ruby objects. David -- David Alan Black home: dblack@superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav