> Right now, the default behavior of perl is that un-initialized variables > are automatically undef. It would be weird to have to do explicit > assignment of an variable to say so. You're right. And as another post mentioned, it's too much "magic". But It's hard to come up with a comfortable syntax for doing both. In C++, you've got two syntaxes for a reason: Objects either live on the stack or the heap. So each syntax has a direct under-the-hood correlation to the different ways of storing an object. I Perl, we don't really care where the object gets stored so it's not as natural to make the distinction. Perhaps the shift-on-the-fly usage could explicitly use a typeglob syntax and declare it to be associated with Dog? my Dog *spot; > if ($age > 12) { > $spot = new Doberman(); > } else { > $spot = new Corgi(); > } Matt
- 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
- Re: RFC 171 (v1) my Dog $spot sh... Michael Fowler
- Re: RFC 171 (v1) my Dog $spo... Michael Fowler
- Re: RFC 171 (v1) my Dog $spot should ... Damian Conway