From: Eric Mahurin Date: 2006-09-21T23:20:16+09:00 Subject: Re: [ANN] Ducktator - A Duck Type Validator ------=_Part_4423_13450074.1158848412761 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 9/21/06, Robert Klemme wrote: > > On 21.09.2006 05:20, Devin Mullins wrote: > > Devin Mullins wrote: > >> Do we need separate terms to describe the different meanings Eric > >> enumerated (and potentially others)? Well, no, but it'd be helpful. > >> I'll start. > > Oh, and lastly: > > > > Can we expect everybody in the world to conform to a standard set of > > vocabulary, should we come to agree on one? HELL NO! > > Devin, I don't want to stress this but you may be underestimating the > value of clear terms a bit. IMHO we should at least /try/ to get a > common understanding of some core concepts so we talk past each other as > little as possible. So, yes I think these discussions are necessary > from time to time. Sometimes the line between persistence and zealotry > is blurred. And unfortunately sometimes these discussions then take > such an unfriendly turn as this thread did. Here is a shot at giving some terms without trying to judge what is best: pure duck typing : just use the object as-is. Don't do anything that will check it to see if it has specific capabilities, ancestors, class, etc. virtual duck typing : the functionality is equivalent to pure duck typing, but for whatever reason #respond_to?, #class, etc has been used. This could be to check capabilities sooner rather than waiting for a method missing, or it could be done for performance reasons by special casing certain classes ( i.e. builtins). duck type : a description of what capabilities an object needs in the context of pure or virtual duck typing. This description could be quite recursive going into the duck type of the arguments passed to the methods and the return values of the methods. complete type : a description of all of the capabilities of an object. multi-method : a method that checks the capabilities or class of an argument to choose between different functionality. Other terms to go along with this: multi-typing?, multi-type?. class conversion : using a method (i.e. #to_*) to convert an object to a specific class. If the result of this conversion must be a specific class (or descendent of) and not just have a certain "duck type", it probably should not be considered duck-typed. ------=_Part_4423_13450074.1158848412761--