develooper Front page | perl.perl6.language | Postings from July 2005

Binding hashes to arrays?

Thread Next
From:
Ingo Blechschmidt
Date:
July 30, 2005 05:59
Subject:
Binding hashes to arrays?
Message ID:
dcftim$vbt$1@sea.gmane.org
Hi,

is binding hashes to arrays (or arrays to hashes) legal? If not, please
ignore the following questions :)

    my @array  = <a b c d>;
    my %hash  := @array;

    say %hash<a>;         # b
    push @array, <e f>;
    say %hash<e>;         # f?
    %hash<X> = "Y";
    say ~@array;          # ???
    # <X Y> (or X => "Y"?) appended to the end of @array?

It seems to me supporting this is hard to get right...


--Ingo

-- 
Linux, the choice of a GNU | Mr. Cole's Axiom: The sum of the
generation on a dual AMD   | intelligence on the planet is a constant;
Athlon!                    | the population is growing.  


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