From: Eric Mahurin Date: 2005-08-19T01:10:42+09:00 Subject: Re: Prototype-based / Ruby question --- "David A. Black" wrote: > >> Obviously any given use of an object does not recapitulate > or > >> encapsulate its entire type, if "type" is defined as the > object's > >> capabilities. > > > > And that is why I think this definition of "type" is not > very > > useful. The definition I gave for duck-type is quite > useful in > > the context of duck-typing - for documenting arguments of > > methods. > > I'm not sure how we've gotten onto documentation. (Yes, I > know it's > all part of programming responsibily....) In ruby, since you don't declare the type of your arguments anywhere in the code (like you would in a statically typed languaage), the only place left to discuss the "type" is in the documentation. I don't see where else "type" really matters. > Anyway, if you > want to > say: "This method takes an argument whose duck type is 'this > object > responds to "x"'", instead of: "This method takes an argument > that > responds to 'x'", be my guest :-) I don't see what it adds. > I prefer > the shorter way. I prefer the shorter way too. There is no reason to use the words duck, type, or a combination of the two, even though you are clearly duck-typing. Similarly, when a you declare a static type to an argument in a statically typed language, you don't use the words static or type (unless either of those are needed keywords in the language). ____________________________________________________ Start your day with Yahoo! - make it your home page http://www.yahoo.com/r/hs