develooper Front page | perl.perl6.language | Postings from August 2001

RE: two-way hashes

Mitchell, Adam R
August 5, 2001 03:15
RE: two-way hashes
Message ID:
sounds like a good idea, but we can't limit multiple values, so it might be
better if it returns an array.  maybe the code should look more like this:

@{value}hash = key

or maybe

@%{value}hash = key

unless this clashes with something else

-----Original Message-----
From: raptor []
Sent: Thursday, August 02, 2001 7:41 AM
Subject: two-way hashes


I tought about a posibility to access a HASH in way that the VALUES can also
be used like KEYS...i.e in perl6 I will say this :

%hash{key} = value;

I want to say also :

{value}hash% = key;

print {value}hash%;#will print the key for this value...

joking :")) but is this good... or I'm talking bullsh...s  again ..
Ofcource this mean that we can't have the same value in the HASH.
===== Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About