On Fri, Sep 01, 2000 at 05:23:27PM +0200, Slaven Rezic wrote: > Often, there is the case that "my" is used before actually assigning a > value to it. For example: > > my Foo $foo; > if ($cond1) { > $foo = new Foo 1, 2, 3; > } else { > $foo = new Foo 2, 4, 6; > } > > If we have implicit constructors, will this cause unnecessary > overhead, that is, calling the implicit constructor and then the real > one? Yes, so don't do that. If you want optimization, I've been suggesting my $spot : isa(Dog) (actually, I've been suggesting my $spot isa(Dog), which was a typo): my $foo : isa(Dog); if ($cond1) { $foo = new Foo 1, 2, 3; } else { $foo = new Foo 2, 4, 6; } Michael -- Administrator www.shoebox.net Programmer, System Administrator www.gallanttech.com --
- Re: RFC 171 (v2) my Dog $spot shoul... Michael Fowler
- Re: RFC 171 (v2) my Dog $spot s... David E. Wheeler
- Re: RFC 171 (v2) my Dog $spot s... Michael Fowler
- Re: RFC 171 (v2) my Dog $spot s... Bart Lateur
- Re: RFC 171 (v2) my Dog $spot s... Michael Fowler
- Re: RFC 171 (v2) my Dog $spot s... Piers Cawley
- Re: RFC 171 (v2) my Dog $spot should call a cons... Michael Fowler
- Re: RFC 171 (v2) my Dog $spot should call a ... Piers Cawley
- Re: RFC 171 (v2) my Dog $spot should cal... Michael Fowler
- Re: RFC 171 (v2) my Dog $spot should call a constructor i... Slaven Rezic
- Re: RFC 171 (v2) my Dog $spot should call a construc... Michael Fowler
- Re: RFC 171 (v2) my Dog $spot should call a cons... Piers Cawley
- Re: RFC 171 (v2) my Dog $spot should call a constructor i... Michael Fowler