On Tuesday, January 28, 2003, at 01:01 PM, Nicholas Clark wrote:
Hmm. I don't have a strong preference either way, but I'm not sure why (given C<my int @a>):On Tue, Jan 28, 2003 at 12:30:41PM -0800, Austin Hastings wrote:--- Michael Lazzaro <[EMAIL PROTECTED]> wrote:This should cause a blip of some kind. If storing an explicit undef (asmy int @a is Array( default => 5 ); @a[0] = undef;
opposed to "undef but 0" or C<$v = undef; @a[0] = $v;> there should be
an exception. If storing an implicit undef: convert to int (IOW: 0) and
emit a warning.
@a[ undef ]
C<undef> should be autoconverted to 0 with warning, but in:
@a[0] = undef;
C<undef> should _not_ be autoconverted to 0, but instead trigger an exception.
They're both in C<int> context, unless we want to make a special "int being used as an array index" context that's different from normal C<int> context. Seems like C<undef> should be treated like 0 (plus warning) in numeric context either everywhere, or nowhere. (?)
MikeL