On Thu, 2003-11-20 at 11:33, Weirich, James wrote:

> However, my concern is the insistence that only those things that have
> String in their ancestry can have string like behavior and can be passed to
> functions expecting a string like object.
> 
> And this is what I thought Sean was saying (i.e. advocating ancestry
> checks).
> 
> I now think what Sean is some way of "marking" a class to indicate that in
> implements a particular protocol.  That marking could be through
> inheritance, but could also be done by some alternate mechanism.
> 
> This (IMHO) is not nearly as onerous as ancestor checking.  But I'm not
> convinced of its utility yet.  I'll have to think about this.
> 
> Sean, did I capture your thoughts accurately?  Or am I still missing
> something.

Well, you certainly captured my thoughts. That's exactly what I was
suggesting with the "empty module as marker" suggestion. 

Someone rightly pointed out that using modules + is_a? in this way was
probably an abuse of the intention of modules. It's just that there
isn't currently an alternative mechanism. I would personally be very
happy to have something like:

class Duck promises IBird
 ...
end

if someobj.has_promised(IBird)
   ..
end

Regards,

Simon