develooper Front page | perl.perl6.language | Postings from January 2003

Re: Arrays: Default Values

From:
Smylers
Date:
January 28, 2003 14:28
Subject:
Re: Arrays: Default Values
Message ID:
20030128222842.34979.qmail@onion.perl.org
Austin Hastings wrote:

> --- Austin Hastings <austin_hastings@yahoo.com> wrote:
> 
> > No, undef. OTOH, deleting @a[1] would reset it to default.
> 
> Ere someone flames my for using a hash keyword in an array context:
> 
> s/deleting/absquatulating (e.g., via pop, shift, or splice)/

What's wrong with C<delete> in an array context?

If there's to be a distinction between storing an undef value and
resetting to the default value -- and, having read Damian's thoughts on
the matter, I'm almost convinced that there shouldn't be -- then I think
it's much more obvious to distinguish C<delete> and C<undef> rather than
C<undef @a[1]> and C<@a[1] = undef>.

Smylers



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About