Re: RFC 171 (v1) my Dog $spot should call a constructor implicitly

2000-08-30 Thread Michael Fowler
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 {

Re: RFC 171 (v1) my Dog $spot should call a constructor implicitly

2000-08-30 Thread Piers Cawley
Perl6 RFC Librarian [EMAIL PROTECTED] writes: This and other RFCs are available on the web at http://dev.perl.org/rfc/ =head1 TITLE my Dog $spot should call a constructor implicitly Eeeeww. Most of the time I use 'my Dog $spot' is along the lines of: package Dog; sub

Re: RFC 171 (v1) my Dog $spot should call a constructor implicitly

2000-08-30 Thread Hildo Biersma
Jonathan Scott Duff wrote: On Tue, Aug 29, 2000 at 11:04:26PM -0400, Michael Maraist wrote: First greatly stylistic compatibilty. An inexperienced programmer would see: my Dog $spot = "Spot"; And become confused. It's totally unintuitive (at least so far as other mainstream OO

Re: RFC 171 (v1) my Dog $spot should call a constructor implicitly

2000-08-30 Thread Nathan Wiger
What, then, happens to the following code: my Dog $spot; if ($age 12) { $spot = new Doberman(); } else { $spot = new Corgi(); } This is a tricky case that deserves a lot of attention, but not exactly as written. Imagine this code block: my int ($x, $y, $z) = (4, 5, 6);

Re: RFC 171 (v1) my Dog $spot should call a constructor implicitly

2000-08-30 Thread Matt Youell
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

Re: RFC 171 (v1) my Dog $spot should call a constructor implicitly

2000-08-29 Thread Matt Youell
mainstream OO languages go). It looks like Dog could be a type of String subclass. That was my first thought as well. Besides, I'd rather type: my Dog $spot("Spot"); Which says everything that needs to be said without any repetition, and it's fairly intuitive. As with the above, the

Re: RFC 171 (v1) my Dog $spot should call a constructor implicitly

2000-08-29 Thread Michael Fowler
On Tue, Aug 29, 2000 at 11:04:26PM -0400, Michael Maraist wrote: First greatly stylistic compatibilty. An inexperienced programmer would see: my Dog $spot = "Spot"; And become confused. It's totally unintuitive (at least so far as other mainstream OO languages go). It looks like Dog