On Tue, Aug 29, 2000 at 12:57:07PM -0700, Matt Youell wrote:
> So perhaps sometimes in Perl we could say:
>
> my Dog $spot = undef; # Automagically knows to be a Dog ref instead
> of a Dog object because of the undef.
> if ($age > 12) {
> $spot = new Doberman();
> } else {
> $spot = new Corgi();
> }
That's a little too special-case and magical for my tastes. What if the
programmer really wants to call the constructor with an undef argument? Or
what if the programmer calls my Dog $spot = $foo, expecting $foo to be
defined, but it isn't? That would end up being a difficult to trace bug.
Michael
--
Administrator www.shoebox.net
Programmer, System Administrator www.gallanttech.com
--
- Re: RFC 171 (v1) my Dog $spot should call a const... Matt Youell
- Re: RFC 171 (v1) my Dog $spot should call a c... Nathan Wiger
- Re: RFC 171 (v1) my Dog $spot should call... Michael Fowler
- Re: RFC 171 (v1) my Dog $spot should ... Nathan Wiger
- Re: RFC 171 (v1) my Dog $spot should call a const... Michael Fowler
- Re: RFC 171 (v1) my Dog $spot should call a const... Jonathan Scott Duff
- Re: RFC 171 (v1) my Dog $spot should call a c... Hildo Biersma
- Re: RFC 171 (v1) my Dog $spot should call... Piers Cawley
- Re: RFC 171 (v1) my Dog $spot should call a constructo... Hildo Biersma
- Re: RFC 171 (v1) my Dog $spot should call a const... Matt Youell
- Re: RFC 171 (v1) my Dog $spot should call a c... Michael Fowler
- Re: RFC 171 (v1) my Dog $spot should call a c... Hildo Biersma
- Re: RFC 171 (v1) my Dog $spot should call... Nathan Wiger
- Re: RFC 171 (v1) my Dog $spot should call... Matt Youell
- Re: RFC 171 (v1) my Dog $spot should call a const... Michael Fowler
- Re: RFC 171 (v1) my Dog $spot should call a const... Nathan Wiger
- Re: RFC 171 (v1) my Dog $spot should call a constructo... Piers Cawley
- Re: RFC 171 (v1) my Dog $spot should call a const... Nathan Wiger
- Re: RFC 171 (v1) my Dog $spot should call a c... Piers Cawley
- Re: RFC 171 (v1) my Dog $spot should call... Michael Fowler
- Re: RFC 171 (v1) my Dog $spot should ... Piers Cawley
