From: "David A. Black" Date: 2003-12-15T01:25:18+09:00 Subject: Re: inplace assignment On Mon, 15 Dec 2003, T. Onoma wrote: > On Sunday 14 December 2003 03:59 pm, David A. Black wrote: > > I'm not sure what you mean by "duck similar" (the notion of duck > > typing doesn't scale well to "duck "), but assuming you > > mean a class that defines methods with the same names and arities as > > another class, the best thing would probably be to do: > > See, you knew exactly what I was talking about, and I only used two words! > Seems to scale fairly well ;-) Two classes being described as "duck similar" brings the whole thing back to a tight bonding between class and type. At the very least, someone who was new to the notion of duck typing, or encountered it subsequent to having been told that two Class objects exhibited "duck similar[ity]" precisely because they defined similar interface (which is exactly what duck typing does *not* reflect), would, I expect, find it that much harder to grasp that the point of "duck typing" is that it offers an alternative to class-based ways of thinking about type. This doesn't mean that two classes can't have similarly named methods; it just means that there's nothing 'duck'-related about it. If anything, the relation of duck typing to class objects would have to do with their dynamic profiles, particularly as regards singleton (class) methods. David -- David A. Black dblack@wobblini.net