From: Martin DeMello Date: 2003-09-14T15:22:37+09:00 Subject: Re: Duck Typing Ryan Pavlik wrote: > Therefore: Based on statements 1-5, "duck typing" is not specific to > ruby, but rather made possible by the dynamic nature of a language. > Based on statements 6-7, duck typing is neither specifically provided > for nor compulsory, so it is not an attribute of the language. > > Thus, because it can be practiced, or not practiced; in ruby, or in > other languages; it must be a _style_ available in dynamic languages, > rather than a specific feature of a particular language. No, it's related to the question "what is an object's type?" as distinct from "what is the class used to instantiate the object?". The phrase "duck typing" is no more and no less than a shorthand for "an object's type is determined entirely by the set of messages it responds to", by analogy with "static typing" (an object's type is determined by a compile-time declaration) and arguably as nothing more than a more precise way of saying "dynamic typing". Any yes, it's by no means specific to Ruby, but it is the way the language defines a 'type'. martin