Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^4: Introducing MooseX::hasn't

by tobyink (Abbot)
on Apr 03, 2012 at 13:14 UTC ( #963241=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Introducing MooseX::hasn't
in thread Introducing MooseX::hasn't

No, polymorphism doesn't depend on inheritance, and I never claimed that it did. Polymorphism is generally an expected outcome of inheritance though. There are clearly other ways of allowing polymorphism though - roles as you say; also mocking, delegation, etc.

perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'


Comment on Re^4: Introducing MooseX::hasn't
Replies are listed 'Best First'.
Re^5: Introducing MooseX::hasn't
by Arunbear (Parson) on Apr 03, 2012 at 17:58 UTC
    From the POD:
    The idea behind polymorphism is that if Bar inherits from Foo, then I should be able to use an object of type Bar wherever I'd normally use Foo.
    That makes it sound like you're equating polymorphism with inheritance.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://963241]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (13)
As of 2015-07-30 19:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (273 votes), past polls