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

Binding hashes to arrays?

Thread Next
Ingo Blechschmidt
July 30, 2005 05:59
Binding hashes to arrays?
Message ID:

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...


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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About