develooper Front page | perl.perl6.language.data | Postings from September 2000

Re: RFC 196 (v1) More direct syntax for hashes

Thread Previous | Thread Next
From:
Bart Lateur
Date:
September 8, 2000 02:08
Subject:
Re: RFC 196 (v1) More direct syntax for hashes
Message ID:
j0bhrs474i1dd1g344i4fr908khm4o6lb9@4ax.com
On Wed, 6 Sep 2000 22:58:05 -0400, John Porter wrote:

>	keys %hash = @things;
>
>is defined as being equivalent to
>
>	@hash{ @things } = ();

Two more details to think about:

	%hash = ( b => 'beta', d => 'delta' );
	keys %hash = qw(a b c);

What happens to the values that were in %hash before? IMO, 'd' would be
removed, because it's not in the hash keys any more; but 'b'? Should
it's value be wiped, or remain what it was? I think it should be
preserved.

-- 
	Bart.

Thread Previous | Thread Next


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