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:
John Porter
Date:
September 6, 2000 19:58
Subject:
Re: RFC 196 (v1) More direct syntax for hashes
Message ID:
20000906225804.A26648@min.net
> More direct syntax for hashes
> 
>   Maintainer: Nathan Torkington <gnat@frii.com>
>   Date: 5 Sep 2000
>   Mailing List: perl6-language-data@perl.org
>   Version: 1
>   Number: 196

Nat, I was thinking of writing an RFC on a related issue...
but it could piggy-back on this one (196) if you like the idea.

To wit: assignment to C<keys(%hash)> changes the hash's set
of keys so as to contain only the (key-ized) values in the RHS.
Iow,

	keys %hash = @things;

is defined as being equivalent to

	@hash{ @things } = ();

This is to support hash-based set operations in a more
natural way, i.e.

	keys %hash = grep { exists $a{$_} } keys %b;


-- 
John Porter

	We're building the house of the future together.


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