Re: RFC 171 (v2) my Dog $spot should call a constructor implicitly
[email protected] (Michael Fowler)
| Newsgroups | perl.perl6.language.objects |
|---|---|
| Message-ID | <[email protected]> |
On Fri, Sep 01, 2000 at 10:22:49AM +0100, Piers Cawley wrote:
> And then there's:
>
> - Makes factory methods impossible.
my Dog $spot;
my $pub = $spot->procreate;
Sure looks like a factory method to me. Just because you don't get to say
my Dog $pup for some optimization doesn't mean they're impossible.
> - Conveniently forgets all about polymorphism.
package Mammal;
sub hair_color { ... }
package Dog;
use base qw(Mammal);
sub CREATE { bless({}, "Dog") }
package main;
my Dog $spot;
$spot->hair_color("blue"); # works just fine
I'm not proposing revamping the entire OO system, and I'd like to know what
made you think I was.
Michael
--
Administrator www.shoebox.net
Programmer, System Administrator www.gallanttech.com
--