On Wed, 2003-01-29 at 17:50, Spider Boardman wrote:
> 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

This has changed since I last (long ago) looked at the source for av.c.
It once was the case that av_fetch could return NULL for uninitialized
cells, which is why it returns an C<SV**> instead of an C<SV*>. It now
looks like you're right and newly allocated cells are given a default
"undeffing".

None the less, the point is valid. We do not HAVE to fill newly
allocated arrays with undef. That yeilds a perfectly respectable
non-existent case.

The question is, do we *want* to do that and is it suitable to the
current Parrot implementation?

-- 
Aaron Sherman <[EMAIL PROTECTED]>
This message (c) 2003 by Aaron Sherman,
and granted to the Public Domain in 2023.
Fight the DMCA and copyright extension!


Reply via email to