RE: Autovivification

[email protected] ("Erik Steven Harrison")
Newsgroups perl.perl6.documentation
Organization Angelfire (http://email.angelfire.mailcity.lycos.com:80)
Message-ID <[email protected]>
 
--

On Mon, 11 Nov 2002 13:02:12  
 Brent Dax wrote:
>Erik Steven Harrison:
># >I think that, if Perl can determine the type with virtually no 
># >ambiguity, it should autovivify.
># 
># Actually, this behavior has already (mostly) been decided over in P6 
># language. It was decided (and I agree) that the Perl 5 behavior of 
>
>Can you give me a link or a thread name or something?

No, because I am crazy and hallucinated it. I turned a
 thread on autovification of read only values and then 
filled in my own, biased opinion. Consider my right to 
post removed.


>
># autovivifying references to the basic data types is the incorrect 
># behavior, leading to a lot of bugs when dealing wityh complex data 
># structures. So no autovifiying an untyped $undefined_var[$foo]
>
>Why?  It's pretty obvious that you want an array, and the normal array
>Perl 6 provides is a good default.
>
>If this is the case, why should we allow C<my @foo> or C<[qw(anon
>array)]> without a type?  After all, they might *really* want a
>different type of array!

I always liked that Perl would autovivify references 
if I assumed that the data was there. And then I 
actually started to write some complex (for me at the 
time) tree walking code, only to mangle the structure. 
A few slips in a for loop, and boom, the whole thing 
fritzed.

But then, I'm a self taught hobbyist. So I may not be 
the population we need to play to.


>
>My understanding was that Perl 6 is not abandoning the DWIM principle.
>When did this change?
>
>(Sorry if this sounds like I'm attacking you.  I'm not--I'm just
>attacking your opinion. :^) )

Oh good. My opinion has been getting uppity lately. This should put it in line. :-)

-Erik
>--Brent Dax <[email protected]>
>@roles=map {"Parrot $_"} qw(embedding regexen Configure)
>
>Wire telegraph is a kind of a very, very long cat. You pull his tail in
>New York and his head is meowing in Los Angeles. And radio operates
>exactly the same way. The only difference is that there is no cat.
>    --Albert Einstein (explaining radio)
>
>


____________________________________________________________
Get 25MB of email storage with Lycos Mail Plus!
Sign up today -- http://www.mail.lycos.com/brandPage.shtml?pageId=plus
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.