develooper Front page | perl.perl6.language | Postings from June 2006

Re: easier duck typing in .can

Thread Previous
From:
Yuval Kogman
Date:
June 18, 2006 04:17
Subject:
Re: easier duck typing in .can
Message ID:
20060618111634.GG12121@woobling.org
On Sun, Jun 18, 2006 at 18:08:00 +1200, Sam Vilain wrote:

> Why would you not use .does or .isa there?  Are you wanting this
> to go through all of the Class/Role's methods and check that the
> $object.can() them?

Because if you don't control $object's class you can't change it.

-- 
  Yuval Kogman <nothingmuch@woobling.org>
http://nothingmuch.woobling.org  0xEBD27418


Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About