User-defined behaviour of hashes in list context

1 view
Skip to first unread message

Ingo Blechschmidt

unread,
Jul 20, 2005, 8:50:34 AM7/20/05
to perl6-l...@perl.org
Hi,

according to Damian [1]...:

my %hash = (a => 1, b => 2);
my @array = %hash;
say @array[0].isa(Pair); # true

How can I override this behaviour?

class MyHash is Hash {
# Please fill in here
}

my %hash is MyHash = (a => 1, b => 2);
my @array = %hash; # should call my own routine


--Ingo

[1]
http://groups.google.de/group/perl.perl6.language/msg/dc552000b7c6191e

--
Linux, the choice of a GNU | Row, row, row your bits, gently down the
generation on a dual AMD | stream...
Athlon! |

Reply all
Reply to author
Forward
0 new messages