On Thu, 2004-02-12 at 11:49, Larry Wall wrote:

> What I'm currently thinking about is a "does" predicate that tells you
> if an object/class does a particular role completely.  If you pull
> part of a role into a class, it returns false, because it doesn't do
> the complete role.  However, if you use "like" instead, it returns a
> number between 0 and 1 telling you what fraction of the role's methods
> it uses.  So you can ask if your object is more like a Dog or a Tree.

> Unless someone comes up with a better idea, of course.  Obviously .does()
> is redundant with .like() == 1.  But it seems like a useful redundancy.

Is it more useful to find the Dog-like-ness of a class or the notion
that SomeClass.bark() is semantically Dog-like, not Tree-like?

I expect to care more that the object does something Dog-like with the
methods I'm about to call on it than how Dog-like it is in general. 
Maybe that's slicing does() way too thin, but like() seems to care an
awful lot about the implementation of how some class does some role.

-- c

Reply via email to