On 29 Jan 2003 14:29:52 -0500, Aaron Sherman wrote (in part):

ajs> As for the argument that testing for true non-existentness is a
ajs> burden, check out the way Perl5 does this.  Hint: there's a central
ajs> sv_undef, and that's not what array buckets are initialized to....

Either you're dead wrong, or you typo'd there.  After

        my @a;
        $a[4] = 1;

The array buckets @a[0..3] most certainly ARE initialized to &PL_sv_undef
in p5.  That's how C<exists $a[2]> knows to return false (&PL_sv_no)
instead of true (&PL_sv_yes).  And, yes, C<delete $a[4]> re-sets that slot
to point to the one true central undef again.  This is different from what
happens on C<undef $a[1];> -- that actually makes a new SV which is a
*copy* of the central undef and makes that the new value in that slot.
Thus, even with just the above sequence, C<exists $a[1]> would now be true
in p5.

Please, folks, this discussion's getting complicated enough without making
mistaken claims about what p5 currently does, even when that's by accident.

-- 
Spider Boardman (at home)                     [EMAIL PROTECTED]
The management (my cats) made me say this.    http://users.rcn.com/spiderb/
PGP public key fingerprint: 96 72 D2 C6 E0 92 32 89  F6 B2 C2 A0 1C AB 1F DC

Reply via email to