From: "David A. Black" Date: 2005-01-26T21:31:29+09:00 Subject: Re: Injecting methods from one class into another. Hi -- On Wed, 26 Jan 2005, E S wrote: > Duck typing, essentially, means that, /in a particular context/, a > given object has all the characteristics of a given type. For example, > it might be enough for an object to implement [] and []= for it to be > treated as a Hash in a certain context. It's not exactly that it's being treated as a Hash -- it's more that, *like* a Hash, it's being treated as an object that responds to [] and []=. This is, perhaps, a subtle point, but I think it's key in getting away from the class-based view. All of the []/[]= objects converge on the type that can only be described as "the type of objects that respond to [] and []=". In that sense, Hashes are just one of infinitely many possible objects that exhibit the behaviors of that type. David -- David A. Black dblack@wobblini.net