Jump to content

Talk:Autovivification

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia


How does one pronounce

[edit]

How does one pronounce this word? Nalpdii 15:09, 13 October 2006 (UTC)[reply]

This page is referenced the perl article

[edit]

This page is referenced by the perl article via see also reference. It's probably thus misidentified as orphaned, though the reference is rather indirect. --Shoka 14:38, 19 September 2007 (UTC)[reply]

Clear as mud

[edit]

Needs an explanation that someone without any Perl knowledge can understand, never mind the Perl debugger. m.e. (talk) 08:07, 31 May 2008 (UTC)[reply]

Is this unique to Perl?

[edit]

The article says: "Autovivification is a unique feature of the Perl programming language (...) This is in contrast to most other high level languages (...) This includes (...) PHP". However, using a variable as an (associative) array in PHP, automatically creates the array as well. An example:

$foo['first'] = 'bar';
$foo[][]      = 'baz';
print_r($foo);

...will print the following (without warnings):

Array
(
    [first] => bar
    [0] => Array
        (
            [0] => baz
        )

)

Isn't this autovivification as well, or am I missing some nuance? Datamagi (talk) 22:48, 15 June 2008 (UTC)[reply]

The "unique feature" verbage should probably be rephrased "distinguishing feature" or better yet just taken out. You are not likely to hear the term used outside of the perl community, but that does not mean other languages do not have the same or similar feature. dr.ef.tymac (talk) 23:17, 15 June 2008 (UTC)[reply]
The difference is: with PHP (and other languages) this only happens when creating variables (using assignment). In Perl, on the other hand, this happens always when a variable is dereferenced:
In PHP, this prints 0:
$foo[0] = "";
if ($foo[1][2]) {} # $foo is not changed
print (defined($foo[1])? 1 : 0);
In Perl, this prints 1:
$foo[0] = "";
if ($foo[1][2]) {} # $foo[1] is dereferenced, and springs into existence
print defined($foo[1]);
If Perl would not have autovivification, it would not create $foo[1] and print 0 like PHP and other languages do. MrBlueSky (talk) 20:08, 15 July 2008 (UTC)[reply]
It maybe very helpful in understanding this topic to have an example like the one above in the article. Mfb52 (talk) 11:45, 2 July 2009 (UTC)[reply]

Autovivification in Python: nested defaultdicts with a specific final type

[edit]

'autovivificious' -- etymology?

[edit]

autovivificious seems to have originated in this article? I'm not used to wikipedia being a primary source. 76.91.197.163 (talk) 19:09, 22 November 2013 (UTC)[reply]